Windows Server 2003 in a Nutshell
| prnqctl | new in WS2003 |
Clears a print queue, prints a test page, and pauses/resumes a printer.
Syntax
prnqctl -e -m -x -z [-s RemoteComputer ] -p PrinterName
Options
- -e
-
Prints a test page
- -m
-
Resumes a printer
- -x
-
Cancels all jobs in a print queue
- -z
-
Pauses a printer
- -s RemoteComputer
-
Name of print server
- -p PrinterName
-
Name of printer
Examples
Pause the SalesPrinter printer on the local computer:
prnqctl -z -p SalesPrinter Microsoft (R) Windows Script Host Version 5.6 Copyright (C) Microsoft Corporation 1996-2001. All rights reserved. Success Pause Printer SalesPrinter
Resume the printer:
prnqctl -m -p SalesPrinter Microsoft (R) Windows Script Host Version 5.6 Copyright (C) Microsoft Corporation 1996-2001. All rights reserved. Success Resume Printer SalesPrinter
Clear the print queue of all jobs:
prnqctl -x -p SalesPrinter Microsoft (R) Windows Script Host Version 5.6 Copyright (C) Microsoft Corporation 1996-2001. All rights reserved. Success Purge Printer SalesPrinter
Use prnjobs to verify the queue is empty:
prnjobs -l -p SalesPrinter Microsoft (R) Windows Script Host Version 5.6 Copyright (C) Microsoft Corporation 1996-2001. All rights reserved. Number of print jobs enumerated 0
Notes
-
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.
-
It may take a few seconds for the last job to clear when using the -x switch. Don't run the prnqctl -x command again before the queue is cleared or a printing error may result and the final job may be stuck in the queue.
See Also
Printing , prncnfg , prndrvr , prnjobs , prnmngr