福昕阅读器命令行参数(返回错误codeS?) [英] Foxit Reader Command Line Arguments (Return Error Codes?)

查看:1523
本文介绍了福昕阅读器命令行参数(返回错误codeS?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过批处理文件使用福昕阅读器通过一个FOR循环打印PDF文件:

 设置打印= C:\\ PDF \\打印
SET狐狸= C:\\ Program Files文件\\福昕软件\\福昕阅读器\\福昕Reader.exe
FOR %% f由于(%印刷%\\ *。*)DO狐狸%%-p%%〜FF

我想创建一个调用命令的错误code和允许我用它做什么IF语句。有谁知道错误codeS存储(或者,如果福昕返回错误codeS在命令行打印命令?)

即。

  FOR %% f由于(%印刷%\\ *。*)DO(
IF%ERRORLEVEL%==0(
狐狸%%-p%%〜FF
)ELSE(
ECHO %%〜NXF无法打印>> Errorlog.txt中



解决方案

发现了一个解决方法:

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

在'L'切换使用,它会列出目前正在由本地主机处理的所有的PrintJob。我至少可以管一个find命令来定位当前的PrintJob在队列中,如果它不存在,我知道,它无法打印,然后我可以执行ErrorHandling中的文件。

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
)
)

解决方案

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.

这篇关于福昕阅读器命令行参数(返回错误codeS?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆