Foxit Reader Command Line Arguments (Return Error Codes?)

蹲街弑〆低调 提交于 2020-01-06 14:04:42

问题


Using Foxit Reader through batch file to print PDF files via a FOR loop:

SET printing=C:\PDF\Printing
SET fox=C:\Program Files\Foxit Software\Foxit Reader\Foxit Reader.exe
FOR %%F IN (%printing%\*.*) DO "%fox%" -p "%%~fF"

I would like to create an IF statement that calls the error code of the command and allows me to do something with it. Does anyone know how the error codes are stored (or if FOXIT returns error codes for the command line print command?)

I.E.

FOR %%F IN (%printing%\*.*) DO (
IF "%ERRORLEVEL%"=="0" (
"%fox%" -p "%%~fF"
) ELSE (
ECHO %%~nxF FAILED TO PRINT>>Errorlog.txt
)
)

回答1:


Found a workaround:

CSCRIPT C:\WINDOWS\system32\PRNJOBS.VBS -l

Used with the 'l' switch, it will list all printjobs currently being processed by the localhost. I can at least pipe a find command to locate the current printjob in the queue and if it doesn't exist, I know that it failed to print and then I can perform errorhandling on the file.



来源:https://stackoverflow.com/questions/6256906/foxit-reader-command-line-arguments-return-error-codes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!