I'm trying to write a 2 line .bat file in Windows 7 to search recursively in the root folder and subfolders for pdfs and print them however the FORFILES
command as in my file:
set fxread="C:\Program Files (x86)\Foxit Software\Foxit Reader\FoxitReader.exe"
forfiles /s /m *.pdf /c "%fxread% /p @FILE"
Gives the following error:
ERROR: Invalid argument/option - 'Files'.
However if I just use FORFILES
to echo the filename I get as expected a list of pdf files; i.e this code:
forfiles /s /m *.pdf /c "cmd /c echo @FILE"
Produces a list of pdf files, one per line and encased in quotation marks.
Anyone know why I can't pass these files to the PDF viewer for printing? Note that this command does print a pdf file as expected:
%fxread% /p "FILE_NAME.pdf"