windows - Problem with quoted filenames in Batch -
let have batch program:
set foo=c:\temp\%1 bar.exe %foo%
when call double quoted file name argument these quotes in middle; , fact prevents other programs working correctly:
> fail.bat "aa bb.jpg" set foo=c:\temp\"aa bb.jpg" > bar.exe c:\temp\"aa bb.jpg" cannot find file
how variable containing correct value "c:\temp\aa bb.jpg"?
you can use %~1
instead, removes quotes parameter.
code should like
set foo="c:\temp\%~1" bar.exe %foo%
Comments
Post a Comment