Export (0) Print
Expand All

Prnjobs.vbs

Updated: January 21, 2005

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2

Prnjobs.vbs

Pauses, resumes, cancels, and lists print jobs. Used without parameters, prnjobs.vbs displays command-line help for the prnjobs.vbs command.

To pause a print job

Syntax

cscript prnjobs -z [-sRemoteComputer]-pPrinterName-jJobNumber [-uUserName-wPassword]

Parameters
-z
Required. Specifies that you want to pause a print job.

-s RemoteComputer
Specifies, by name, the remote computer to which the print job you want to pause was sent. If you do not specify a computer, the local computer is used.

-p PrinterName
Required. Specifies, by name, the printer that would print the job you want to pause.

-j JobNumber
Required. Specifies, by ID number, the print job you want to pause.

-u UserName -w Password
Specifies an account with permissions to connect by using Windows Management Instrumentation (WMI) services to the computer to which the print job you want to pause was sent. All members of the Administrators group for that computer 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. For more information on WMI, see Related Topics.

/?
Displays help at the command prompt.

Remarks
  • This command starts a script that is located in the systemroot\system32 directory. You must type this command at a command prompt with that directory as the current directory, or you must type the full path to that directory at the beginning of the cscript command.

  • To display a list of print jobs and their ID numbers, use this command with the -l parameter.

  • If the information that you supply contains spaces, use quotation marks around the text (for example, "Computer Name").

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:

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

To resume a print job

Syntax

cscript prnjobs -m [-sRemoteComputer]-pPrinterName-jJobNumber [-uUserName-wPassword]

Parameters
-m
Required. Specifies that you want to resume a print job.

-s RemoteComputer
Specifies, by name, the remote computer to which the print job you want to resume was sent. If you do not specify a computer, the local computer is used.

-p PrinterName
Required. Specifies, by name, the printer that will print the job you want to resume.

-j JobNumber
Required. Specifies, by ID number, the print job you want to resume.

-u UserName -w Password
Specifies an account with permissions to connect by using Windows Management Instrumentation (WMI) services to the computer to which the print job you want to resume was sent. All members of the Administrators group for that computer 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. For more information on WMI, see Related Topics.

/?
Displays help at the command prompt.

Remarks
  • This command starts a script that is located in the systemroot\system32 directory. You must type this command at a command prompt with that directory as the current directory, or you must type the full path to that directory at the beginning of the cscript command.

  • To display a list of print jobs and their ID numbers, use this command with the -l parameter.

  • If the information that you supply contains spaces, use quotation marks around the text (for example, "Computer Name").

To cancel a print job

Syntax

cscript prnjobs -x [-sRemoteComputer]-pPrinterName-jJobNumber [-uUserName-wPassword]

Parameters
-x
Required. Specifies that you want to cancel a print job.

-s RemoteComputer
Specifies, by name, the remote computer to which the job you want to cancel was sent. If you do not specify a computer, the local computer is used.

-p PrinterName
Required. Specifies, by name, the printer that would print the job that you want to cancel.

-j JobNumber
Required. Specifies, by ID number, the print job you want to cancel.

-u UserName -w Password
Specifies an account with permissions to connect by using Windows Management Instrumentation (WMI) services to the computer to which the print job you want to cancel was sent. All members of the Administrators group for that computer 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. For more information on WMI, see Related Topics.

/?
Displays help at the command prompt.

Remarks
  • This command starts a script that is located in the systemroot\system32 directory. You must type this command at a command prompt with that directory as the current directory, or you must type the full path to that directory at the beginning of the cscript command.

  • To display a list of print jobs and their ID numbers, use this command with the -l parameter.

  • If the information that you supply contains spaces, use quotation marks around the text (for example, "Computer Name").

To list the print jobs in a print queue

Syntax

cscript prnjobs -l [-sRemoteComputer] [-pPrinterName] [-uUserName-wPassword]

Parameters
-l
Required. Specifies that you want to list all the print jobs in a print queue.

-s RemoteComputer
Specifies, by name, the remote computer that hosts the print queue whose jobs you want to list. If you do not specify a computer, the local computer is used.

-p PrinterName
Specifies, by name, the printer whose print queue contains the jobs you want to list. If you do not specify a printer, then all jobs in all print queues are listed.

-u UserName -w Password
Specifies an account with permissions to connect by using Windows Management Instrumentation (WMI) services to the computer that hosts the print queue whose jobs you want to list. All members of the Administrators group for that computer 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. For more information on WMI, see Related Topics.

/?
Displays help at the command prompt.

Remarks
  • This command starts a script that is located in the systemroot\system32 directory. You must type this command at a command prompt with that directory as the current directory, or you must type the full path to that directory at the beginning of the cscript command.

  • To display a list of print jobs and their ID numbers, use this command with the -l parameter.

  • If the information that you supply contains spaces, use quotation marks around the text (for example, "Computer Name").

Examples

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

cscript prnjobs.vbs -l -p ColorPrinter_2

Formatting legend

 

Format Meaning

Italic

Information that the user must supply

Bold

Elements that the user must type exactly as shown

Ellipsis (...)

Parameter that can be repeated several times in a command line

Between brackets ([])

Optional items

Between braces ({}); choices separated by pipe (|). Example: {even|odd}

Set of choices from which the user must choose only one

Courier font

Code or program output

See Also

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft