I'm stuck with this script
echo off SET pathAdobe="C:\Program Files\Adobe\Acrobat DC\Acrobat\Acrobat.exe" SET pathDestination=T:\ cd %pathDestination% (1) forfiles /P %pathDestination% /M *8.pdf /D +0 /C "cmd /c echo @PATH" (2) "C:\Program Files\Adobe\Acrobat DC\Acrobat\Acrobat.exe" /o /h /s /t "%pathDestination%\pdf8.pdf" "MyPrinterName" pause
(1) Work fine, i got a list of pdf according my forfiles
(2) Work fine, print my file
(3) But when i want to mix the 2 first step that doesn't work like i want
forfiles /P %pathDestination% /M *8.pdf /D +0 /C "CMD /C "%pathAdobe%" /o /h /s /t @PATH"
I got this error: Error: Invalid argument or option - « Files\Adobe\Acrobat »
I try to escape with ^ " \ but don't change the result
Can't find a solution!
Thanks for any help you can give me :)
J
Your issue is that you are including double quotes, in the wrong places, and that those double quotes require escaping. You can escape those using backward slashes (
\"), or by using their hexadecimal character code, (0x22).Backward slash example:
Hexadecimal character example: