Help with creating a simple script to rename directories
- deadman36g
- Posts: 9
- Joined: 28 Jan 2014, 02:56
Help with creating a simple script to rename directories
I have currently been using the following command with the filebot gui to rename my movies for me
{n} ({y})/{fn}
Here is an example of what this does
my movie is movie.2014.x264.mkv, it will create the directory 'Movie (2014)' and put my movie file inside this directory.
I am wanting to automate this process.
{n} ({y})/{fn}
Here is an example of what this does
my movie is movie.2014.x264.mkv, it will create the directory 'Movie (2014)' and put my movie file inside this directory.
I am wanting to automate this process.
- deadman36g
- Posts: 9
- Joined: 28 Jan 2014, 02:56
Re: Help with creating a simple script to rename directories
I have been trying but no luck, could you please make me this script?
Re: Help with creating a simple script to rename directories
Command:
Output:
So where is the issue? Cause this stuff documented in details - with examples - on the website, and with many many more examples here in the forums. If you can't be bothered to RTFM I do expect a kind donation for doing it for you. 
Code: Select all
filebot -rename -r . --output "D:/output" --format "TV/{n}/{s}/{n} - {s00e00} - {t}" -non-strict --action copy --db thetvdb
Code: Select all
Rename episodes using [TheTVDB]
Auto-detected query: [True Blood, Blood]
Fetching episode data for [True Blood]
Fetching episode data for [A Drop of True Blood]
Fetching episode data for [Blood+]
Fetching episode data for [Blood-C]
Fetching episode data for [Blood Lad]
Fetching episode data for [Bad Blood]
Fetching episode data for [Hot Blood]
[COPY] Rename [D:\workspace\testdata\AMC-TEST\True.Blood.S05E01.BDRip.XviD-REWARD.avi] to [D:\output\TV\True Blood\5\True Blood - S05E01 - Turn! Turn! Turn!.avi]
Processed 1 files

- deadman36g
- Posts: 9
- Joined: 28 Jan 2014, 02:56
Re: Help with creating a simple script to rename directories
I am sorry I wasn't specific enough
I want this script to leave my filenames as they are. I just want the directory created and the files moved to the directory.
i.e.
movie/new/filebot2014.x264.DTS.mkv
would become
movie/new/Filebot (2014)/filebot2014.x264.DTS.mkv
I want this script to leave my filenames as they are. I just want the directory created and the files moved to the directory.
i.e.
movie/new/filebot2014.x264.DTS.mkv
would become
movie/new/Filebot (2014)/filebot2014.x264.DTS.mkv
Re: Help with creating a simple script to rename directories
Change format:
This exact use-case is give as an example:
http://www.filebot.net/forums/viewtopic.php?f=5&t=2
Please read the manual. It's all there.
Code: Select all
--format "TV/{n}/{fn}"
http://www.filebot.net/forums/viewtopic.php?f=5&t=2
Please read the manual. It's all there.
- deadman36g
- Posts: 9
- Joined: 28 Jan 2014, 02:56
Re: Help with creating a simple script to rename directories
I did RTFM but still have trouble
I have made a few modifications to the code you gave me so that it is now
What does the . between -r and --format represent?
I would like a script that I can autorun with windows that will watch a folder for any changes and run the above code when there is a change.
And for your help on this, and for making such an awesome (and free) app a donation will certainly be coming your way.
I have made a few modifications to the code you gave me so that it is now
Code: Select all
filebot -rename -r . --format "{n} ({y})/{fn}" -non-strict --action move --db imdb
I would like a script that I can autorun with windows that will watch a folder for any changes and run the above code when there is a change.
And for your help on this, and for making such an awesome (and free) app a donation will certainly be coming your way.
Re: Help with creating a simple script to rename directories
The "-r" option tells filebot to handle folders recursively, the "." tells filebot to do it "from the current folder". So say the folder is "movie/new/" then it would tell it to start from "movie/new/". If it was ".." it would tell it to start from one folder below current folder ie "movie/".
Re: Help with creating a simple script to rename directories
-rename "X:/path/to/files" (in your case it's probably best to specify an absolute path)
-r select all files in this folder and sub-folders
--format "expr" naming scheme => http://www.filebot.net/naming.html
--output "Y:/media" folder that will be used to resolve relative naming schemes
-r select all files in this folder and sub-folders
--format "expr" naming scheme => http://www.filebot.net/naming.html
--output "Y:/media" folder that will be used to resolve relative naming schemes
- deadman36g
- Posts: 9
- Joined: 28 Jan 2014, 02:56
Re: Help with creating a simple script to rename directories
Thanks, didn't realize '.' was current folder
So, is it possible for a script to autorun on windows login that will moniter a folder for changes and run my command when there is one?
So, is it possible for a script to autorun on windows login that will moniter a folder for changes and run my command when there is one?
Re: Help with creating a simple script to rename directories
There's this for watching folders:
http://www.filebot.net/forums/viewtopic ... 4&t=5#p132
Though I'd recommend using AMC and set Windows Task Scheduler to call it in intervals:
http://www.filebot.net/forums/viewtopic.php?f=4&t=215
http://www.filebot.net/forums/viewtopic ... 4&t=5#p132
Though I'd recommend using AMC and set Windows Task Scheduler to call it in intervals:
http://www.filebot.net/forums/viewtopic.php?f=4&t=215
- deadman36g
- Posts: 9
- Joined: 28 Jan 2014, 02:56
Re: Help with creating a simple script to rename directories
Ok, I went with the first one because I do not use utorrent and it is working as desired with this script
No, I have a few more questions
1.) How can I keep this running in the background without keeping a cmd window open at all times
2.) I would still like a log kept even if the cmd window is closed, is this possible?
Code: Select all
filebot -script fn:watcher C:\Users\deadman36g\Downloads\MOVIES -rename -r . --format "{n} ({y})/{fn}" -non-strict --action move --db imdb
1.) How can I keep this running in the background without keeping a cmd window open at all times
2.) I would still like a log kept even if the cmd window is closed, is this possible?
Re: Help with creating a simple script to rename directories
1. You can try chp though it might not work:
2. filebot -helpAlternatively you can create a hidden filebot process with this tool: http://www.commandline.co.uk/chp/
Code: Select all
--log-file path/to/log.txt : Log file