How to pass complex arguments in Windows CMD?
How to pass complex arguments in Windows CMD?
Thanks in advance.
I'm a complete newB to all of this, but find it really interesting. I've been trying for multiple days to get this to work for me.
First off it works perfectly in GUI, no issues does everything i want.
What i'm looking for is how do i turn this format expression into a working .bat file. I've tried everything i can find in forums and ideas that come to me.
Have tried using it as my --def movieformat = without any luck while using AMC scripts
This is ChefGregS format expression
viewtopic.php?f=5&t=2&p=36043#p36043
any help would be awesome.
V.
I'm a complete newB to all of this, but find it really interesting. I've been trying for multiple days to get this to work for me.
First off it works perfectly in GUI, no issues does everything i want.
What i'm looking for is how do i turn this format expression into a working .bat file. I've tried everything i can find in forums and ideas that come to me.
Have tried using it as my --def movieformat = without any luck while using AMC scripts
This is ChefGregS format expression
viewtopic.php?f=5&t=2&p=36043#p36043
any help would be awesome.
V.
Re: Any help would be appreciated.
These formats are complex, so escaping them for Windows CMD / BAT is tricky. To be avoided. Use argument files instead.
Use the @file syntax for reading command-line arguments from external text files.

Re: How to pass complex arguments in Windows CMD?
thanks rednoah will give it a shot. will post results
Re: How to pass complex arguments in Windows CMD?
thanks for the help rednoah got it working for the most part. Problem i'm having now is that when i run this movie.bat file:
with this args.txt file:
it deletes my .txt file. They obviously are not stored in the same folder. Do i need to add this to a exclude script?
Code: Select all
filebot -script fn:amc C:\Users\Vince\Downloads\complete --output //SYNOLOGY/Movies --log-file amc.log --def clean=y --def artwork=y --action move --def excludeList=amc.txt --def movieFormat= C:\Users\Vince\Documents\FilebotScripts\args.txt
Code: Select all
{vf == /2160p/ ? 'L:/Movies 4K' : vf =~ /1080p|720p/ ? 'M:/Movies HD' : 'Z:/Movies'}/{n.upperInitial().colon(' - ').replace('?', '!')} {' (' + fn.matchAll(/extended|uncensored|remastered|unrated|uncut|directors.cut|special.edition|redux/)*.upperInitial()*.lowerTrail().sort().join(', ').replaceAll(/[._]/, " ") + ')'} {any{' Part '+pi}{null}} ({y}) {fn.match(/3D/)}/{n.upperInitial().colon(' - ').replace('?', '!')} {' (' + fn.matchAll(/extended|uncensored|remastered|unrated|uncut|directors.cut|special.edition|redux/)*.upperInitial()*.lowerTrail().sort().join(', ').replaceAll(/[._]/, " ") + ')'} {any{' Part '+pi}{null}} [{y}, {any{csv('M:/replacecert1.csv').get(certification)}{certification}{"NR"} }, {runtime} Min] {[actors.take(3).join(', ')]} {[genres.take(3).join(', ')]} [{fn.match(/3D/)+', '}{"$vf, $ac@$af"}]{subt}
Re: How to pass complex arguments in Windows CMD?
What does the log say?
It's called @file because there's an @ character:
It's called @file because there's an @ character:
Code: Select all
--def movieFormat=@/path/to/MovieFormat.groovy
Re: How to pass complex arguments in Windows CMD?
log file actually states that it did delete when performing the cleaning script. but why is it cleaning that file?
when i tried the @ format kept giving me errors. "illegal arguments" if i remember correctly
when i tried the @ format kept giving me errors. "illegal arguments" if i remember correctly
Re: How to pass complex arguments in Windows CMD?
Please read up on how CMD arguments work:
viewtopic.php?f=4&t=1899
GOOD:
Read 2 arguments, [--def] and [movieFormat=@C:\Users\Vince\Documents\FilebotScripts\args.txt] as it should be.
BAD:
Because this parses to 3 arguments, [--def] [movieFormat=] [C:\Users\Vince\Documents\FilebotScripts\args.txt], you're passing in an EMPTY movie format which is subsequently ignored (likely with an error message telling you specifically that movieFormat is off), and then the next argument is interpreted as input file, so you're passing in your text file for processing (and cleaning).
viewtopic.php?f=4&t=1899
GOOD:
Code: Select all
--def movieFormat=@C:\Users\Vince\Documents\FilebotScripts\args.txt
BAD:
Code: Select all
--def movieFormat= C:\Users\Vince\Documents\FilebotScripts\args.txt
Re: How to pass complex arguments in Windows CMD?
will do thanks.
Re: How to pass complex arguments in Windows CMD?
appreciate you time and help