Renaming file and folder from command line

All about user-defined episode / movie / file name format expressions
Post Reply
arielreyes001
Posts: 11
Joined: 29 Jan 2013, 00:35

Renaming file and folder from command line

Post by arielreyes001 »

is it possible to do this from the command line? I am currently using this to rename files from a button in my Directory Opus (file manager) toolbar:
C:\Program Files\FileBot\filebot -rename {F} --format "{n} ({y}) [{vf}]" -non-strict
How can I do the same for the folder that the same file currently resides in. Or even on its own, what's the command so that it only renames a folder, not a file?

I'm thinking this would work:
C:\Program Files\FileBot\filebot -script fn:renall "path/to/movies" -non-strict --db TheMovieDB --def target=folder
However I don't know how to make the "path/to/movies" dynamic. Meaning I want to run this script on the selected folder, or the parent folder of the selected file. Is this possible?
Thanks,
AR
User avatar
rednoah
The Source
Posts: 22999
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Renaming file and folder from command line

Post by rednoah »

I think I answered this one before. The answer is yes. But if you need help with 3rd party tools please check with said 3rd party tools for help. :D
:idea: Please read the FAQ and How to Request Help.
arielreyes001
Posts: 11
Joined: 29 Jan 2013, 00:35

Re: Renaming file and folder from command line

Post by arielreyes001 »

Great! What is the command from the command line?
User avatar
rednoah
The Source
Posts: 22999
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Renaming file and folder from command line

Post by rednoah »

1.
Move files into new structure, as defined by your format. I recommend using absolute paths but relative paths will work as well and will be resolved against the location of the original file.

Code: Select all

../{n} ({y})/{n} ({y}) [{vf}]
2.
Delete remaining folder. You may want to use the cleaner script for that.



That's how I'd do it. The exact cmdline calls you have to write yourself. ;)
:idea: Please read the FAQ and How to Request Help.
arielreyes001
Posts: 11
Joined: 29 Jan 2013, 00:35

Re: Renaming file and folder from command line

Post by arielreyes001 »

So is it the -rename command?
Post Reply