prnjobsprnjobs

适用于: Windows Server (半年通道) ,Windows Server 2019,Windows Server 2016,Windows Server 2012 R2,Windows Server 2012Applies to: Windows Server (Semi-Annual Channel), Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012

暂停、恢复、取消和列出打印作业。Pauses, resumes, cancels, and lists print jobs. 此命令是位于目录中的 Visual Basic 脚本 %WINdir%\System32\printing_Admin_Scripts\<language>This command is a Visual Basic script located in the %WINdir%\System32\printing_Admin_Scripts\<language> directory. 若要在命令提示符下使用此命令,请键入 cscript ,然后键入 prnjobs 文件的完整路径,或将目录更改为相应的文件夹。To use this command at a command prompt, type cscript followed by the full path to the prnjobs file, or change directories to the appropriate folder. 例如:cscript %WINdir%\System32\printing_Admin_Scripts\en-US\prnjobs.vbsFor example: cscript %WINdir%\System32\printing_Admin_Scripts\en-US\prnjobs.vbs.

语法Syntax

cscript prnjobs {-z | -m | -x | -l | -?} [-s <Servername>] [-p <Printername>] [-j <JobID>] [-u <Username>] [-w <password>]

参数Parameters

参数Parameter 说明Description
-Z-z 暂停由 -j 参数指定的打印作业。Pauses the print job specified by the -j parameter.
-M-m 恢复由 -j 参数指定的打印作业。Resumes the print job specified by the -j parameter.
-X-x 取消由 -j 参数指定的打印作业。Cancels the print job specified by the -j parameter.
-l-l 列出打印队列中的所有打印作业。Lists all the print jobs in a print queue.
-s <Servername>-s <Servername> 指定承载要管理的打印机的远程计算机的名称。Specifies the name of the remote computer that hosts the printer that you want to manage. 如果未指定计算机,则使用本地计算机。If you don't specify a computer, the local computer is used.
-p <Printername>-p <Printername> 必需。Required. 指定要管理的打印机的名称。Specifies the name of the printer that you want to manage.
-j <JobID>-j <JobID> 按 ID 号指定 () 要取消的打印作业。Specifies (by ID number) the print job you want to cancel.
-u <Username> -w <password>-u <Username> -w <password> 指定有权连接到承载要管理的打印机的计算机的帐户。Specifies an account with permissions to connect to the computer that hosts the printer that you want to manage. 目标计算机的本地管理员组的所有成员都具有这些权限,但也可以向其他用户授予权限。All members of the target computer's local Administrators group have these permissions, but the permissions can also be granted to other users. 如果未指定帐户,则必须使用具有这些权限的帐户登录,才能使命令正常工作。If you don't specify an account, you must be logged on under an account with these permissions for the command to work.
/?/? 在命令提示符下显示帮助。Displays help at the command prompt.

备注Remarks

  • 如果提供的信息包含空格,请使用引号将文本括起来 (例如,"Computer Name" ) 。If the information that you supply contains spaces, use quotation marks around the text (for example, "Computer Name").

示例Examples

若要将作业 ID 为27的打印作业暂停发送到名为 HRServer 的远程计算机进行打印,请在名为 colorprinter 的打印机上键入:To pause a print job with a job ID of 27 sent to the remote computer named HRServer for printing on the printer named colorprinter, type:

cscript prnjobs.vbs -z -s HRServer -p colorprinter -j 27

若要列出名为 colorprinter_2 的本地打印机的队列中的所有当前打印作业,请键入:To list all current print jobs in the queue for the local printer named colorprinter_2, type:

cscript prnjobs.vbs -l -p colorprinter_2

其他参考Additional References