Prnjobs.vbs


Applies To: Windows Vista,Windows Server 2008

Pauses, resumes, cancels, and lists print jobs.

For examples of how this command can be used, see Examples.

Syntax


Copy Code

Cscript Prnjobs {-z | -m | -x | -l | -?} [-s <ServerName>]
[-p <PrinterName>] [-j <JobID>] [-u <UserName>] [-w <Password>]

Parameters

Parameter

Description

-z

Pauses the print job specified with the -j parameter.

-m

Resumes the print job specified with the -j parameter.

-x

Cancels the print job specified with the -j parameter.

-l

Lists all the print jobs in a print queue.

-s <ServerName>

Specifies the name of the remote computer that hosts the printer that you want to manage. If you do not specify a computer, the local computer is used.

-p <PrinterName>

Specifies the name of the printer that you want to manage. Required.

-j <JobID>

Specifies (by ID number) the print job you want to cancel.

-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 do not 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


Copy Code

Cscript %WINDIR%\System32\Printing_Admin_Scripts\en-US\Prnjobs.vbs

Examples

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:


Copy Code

Cscript Prnjobs.vbs -z -s HRServer -p ColorPrinter -j 27

To list all current print jobs in the queue for the local printer named ColorPrinter_2, type:


Copy Code

Cscript Prnjobs.vbs -l -p ColorPrinter_2

Additional references

Command-Line Syntax Key

Print Command Reference