filebot -rename -r K:\INBOUND5\*.mkv --db TheTVDB -non-strict
This fails to process subdirectories under INBOUND5 directory
Shouldn't the -r switch trigger that behavior?
What did I miss?
batch file help with sub directories
Re: batch file help with sub directories
-r has no effect if you're passing a list of files as input arguments.
If you type *.mkv then the shell will expand that to all the files, and then pass a list of files as input arguments. The command you call can't know if you did *.mkv or typed all the file names one by one.
You'll need to pass the folder as input. And if you want to only process mkv files then you need to use the --file-filter option.
Alternatively, you can do find -exec to find all the mkv files from folder hierarchy and then pass them in to the filebot command as input arguments. This is easy on Linux, maybe not so much if you're using Windows.



Re: batch file help with sub directories
Honestly I appreciate the reply but I do not understand it.
So maybe I have to use find -exec to process all the files in all the subfolders.
I realize you are trying to educate me and I appreciate it, but what do I have to change in this line:
filebot -rename -r K:\INBOUND5\*.mkv --db TheTVDB -non-strict
To have all mkv files under K:\INBOUND5\ processed by filebot
Example
I have filebot to process
K:\INBOUND5\show1\*.mkv
K:\INBOUND5\show1\season1\*.mkv
K:\INBOUND5\show1\season2\*.mkv
K:\INBOUND5\show1\season3\*.mkv
K:\INBOUND5\show2\*.mkv
K:\INBOUND5\show2\*.mkv
K:\INBOUND5\show3\*.mkv
But the folder names will be different every day
So I want to process all mkv files under K:\INBOUND5\ no matter where they are
Same way del *.txt /s deletes all txt files no matter where they are
Thanks for your time and reply.
But I am not passing a list of files. Just using this K:\INBOUND5\*.mkv-r has no effect if you're passing a list of files as input arguments.
excuse my inexperience, but I do not really grasp thatIf you type *.mkv then the shell will expand that to all the files, and then pass a list of files as input arguments. The command you call can't know if you did *.mkv or typed all the file names one by one.
The folder names change depends on what gets downloaded. I just want to process all subfolders no matter what the folders are named.You'll need to pass the folder as input.
I am using Windows 10.Alternatively, you can do find -exec to find all the mkv files from folder hierarchy and then pass them in to the filebot command as input arguments. This is easy on Linux, maybe not so much if you're using Windows.
So maybe I have to use find -exec to process all the files in all the subfolders.
I realize you are trying to educate me and I appreciate it, but what do I have to change in this line:
filebot -rename -r K:\INBOUND5\*.mkv --db TheTVDB -non-strict
To have all mkv files under K:\INBOUND5\ processed by filebot
Example
I have filebot to process
K:\INBOUND5\show1\*.mkv
K:\INBOUND5\show1\season1\*.mkv
K:\INBOUND5\show1\season2\*.mkv
K:\INBOUND5\show1\season3\*.mkv
K:\INBOUND5\show2\*.mkv
K:\INBOUND5\show2\*.mkv
K:\INBOUND5\show3\*.mkv
But the folder names will be different every day
So I want to process all mkv files under K:\INBOUND5\ no matter where they are
Same way del *.txt /s deletes all txt files no matter where they are
Thanks for your time and reply.
Re: batch file help with sub directories
e.g. pass K:\INBOUNDS as first input argument and then have FileBot select all the *.mkv files for processing:
That's a most interesting observation. That shouldn't work, but del is a CMD built-in (and not an executable) so it just works differently I suppose. Windows CMD really never ceases to amaze what what a dumpster fire it is...
Correctly understanding * shell expansion is useful though, because it's universal applicable to all command-line tools on all operating systems. You can use the sysenv script to just mirror the arguments you pass in, so you can compare and contrast and get a feel for how it works:
Code: Select all
filebot -rename -r "K:\INBOUND5" --file-filter "ext == /mkv/" --db TheTVDB -non-strict





Code: Select all
filebot -script fn:sysenv K:\INBOUND5
Code: Select all
filebot -script fn:sysenv K:\INBOUND5\A.mkv K:\INBOUND5\B.mkv K:\INBOUND5\C.mkv
Code: Select all
filebot -script fn:sysenv K:\INBOUND5\*.mkv
Re: batch file help with sub directories
thank youK:\INBOUNDS as first input argument and then have FileBot select all the *.mkv files for processing:
That's for sure and each upgrade of Win gets worse on many levels.Windows CMD really never ceases to amaze what what a dumpster fire it is.
I use Linux Mint on my main computer, It's an old laptop that runs faster than my Windows newer machine. (Both SSD)
Thank you, I have never ran across that before, but now that I have a use for it I will read now. Appreciate your help and your timeCorrectly understanding * shell expansion is useful though, because it's universal applicable to all command-line tools on all operating systems.
Re: batch file help with sub directories
That one has been around and unchanged for 30+ years though probably.



Re: batch file help with sub directories
When this hard drive dies I will switch to Linus Mint for my plex "server" 
