prnjobs | new in WS2003 |
Manages print jobs.
prnjobs {-l -m -x -z} [-s RemoteComputer ] -p PrinterName -j JobNumber
Lists all jobs in the print queue
Resumes a paused print job
Cancels a print job
Pauses a print job
Name of print server
Name of printer
ID number of print job
List print jobs pending in print queue on SalesPrinter :
prnjobs -l -p SalesPrinter Microsoft (R) Windows Script Host Version 5.6 Copyright (C) Microsoft Corporation 1996-2001. All rights reserved. Job id 9 Printer SalesPrinter Document Budget.rtf Data type NT EMF 1.008 Driver name HP Color LaserJet Description SalesPrinter, 9 Machine name \ESRV210D Notify Administrator Owner Administrator Pages printed 0 Parameters Size 131000 Status Job is printing Time submitted 03/27/2003 10:24:32 Job id 10 Printer SalesPrinter Document Report.rtf Data type NT EMF 1.008 Driver name HP Color LaserJet Description SalesPrinter, 10 Elapsed time 00:00:00 Machine name \ESRV210D Notify Administrator Owner Administrator Pages printed 0 Parameters Size 152292 Status Time submitted 03/27/2003 10:24:40 Job id 11 Printer SalesPrinter Document Resume.rtf Data type NT EMF 1.008 Driver name HP Color LaserJet Description SalesPrinter, 11 Elapsed time 00:00:00 Machine name \ESRV210D Notify Administrator Owner Administrator Pages printed 0 Parameters Size 87928 Status Time submitted 03/27/2003 10:24:47 Number of print jobs enumerated 3
Pause job 10:
prnjobs -z -p SalesPrinter -j 10 Microsoft (R) Windows Script Host Version 5.6 Copyright (C) Microsoft Corporation 1996-2001. All rights reserved. Success Pause Job id 10 Printer SalesPrinter
Verify the result:
prnjobs -l -p SalesPrinter Microsoft (R) Windows Script Host Version 5.6 Copyright (C) Microsoft Corporation 1996-2001. All rights reserved. Job id 9 Printer SalesPrinter Document Budget.rtf Data type NT EMF 1.008 Driver name HP Color LaserJet Description SalesPrinter, 9 Machine name \ESRV210D Notify Administrator Owner Administrator Pages printed 0 Parameters Size 100220 Status Job is printing Time submitted 03/27/2003 10:24:32 Job id 10 Printer SalesPrinter Document Report.rtf Data type NT EMF 1.008 Driver name HP Color LaserJet Description SalesPrinter, 10 Elapsed time 00:00:00 Machine name \ESRV210D Notify Administrator Owner Administrator Pages printed 0 Parameters Size 152292 Status Job is paused <---NOTE Time submitted 03/27/2003 10:24:40 Job id 11 Printer SalesPrinter Document Resume.rtf Data type NT EMF 1.008 Driver name HP Color LaserJet Description SalesPrinter, 11 Elapsed time 00:00:00 Machine name \ESRV210D Notify Administrator Owner Administrator Pages printed 0 Parameters Size 87928 Status Time submitted 03/27/2003 10:24:47 Number of print jobs enumerated 3
Resume job 10:
prnjobs -m -p SalesPrinter -j 10 Microsoft (R) Windows Script Host Version 5.6 Copyright (C) Microsoft Corporation 1996-2001. All rights reserved. Success Resume Job id 10 Printer SalesPrinter
Cancel job 10:
prnjobs -x -p SalesPrinter -j 10 Microsoft (R) Windows Script Host Version 5.6 Copyright (C) Microsoft Corporation 1996-2001. All rights reserved. Success Cancel Job id 10 Printer SalesPrinter
Unfortunately, you can pause, resume, or cancel only one job at a time using this command. See prnqctl later in this chapter to pause or resume a printer or cancel all jobs in a print queue.
This command is a .vbs script and requires CScript to run. You can make CScript your default script host by typing the following at the command prompt:
cscript //h:cscript //s
This command requires Administrator credentials. If logged on with different credentials, use -u UserName -w Password to specify suitable credentials.
Printing , prncnfg , prndrvr , prnmngr , prnqctl