Page 1 of 1

Help, Command works but not in batch file?

Posted: 2019-03-06T09:16:34-07:00
by jvlopez
I'm running a command, which works perfectly when I type/copy it into PowerShell

Code: Select all

magick "%~dpnx1" C:/wmjvlopez.png -resize "x%[fx:t?u[0].h/18:u[0].h]" -gravity southwest -composite "%~dpn1_wmjvlopez.jpg"
If I use this command in a batch file, it fails with the following error
magick: invalid argument for option '-resize' 'xt?u[0].h/18:u[0].h]' at CLI arg 3 @ error/operation.c/CLISimpleOperatorImage/3136.
I can't figure it out and am at my wits end. If anyone can suggested anything I'd be in their debt!!

Re: Help, Command works but not in batch file?

Posted: 2019-03-06T09:22:00-07:00
by dlemstra
You will need to escape the percentage (%% instead of %)

Re: Help, Command works but not in batch file?

Posted: 2019-03-06T09:26:31-07:00
by jvlopez
That worked, thanks a million for your help :)