Delete everything in the printer queue

M

Mint

Is there a way to delete everything in the printer queue using maybe
a batch file?
This would save paper and time.

I am sometimes at a computer where others walk away from it and there
are items in the printer queue.

Then when I print something, I have to wait while other pages come
out.

Thanks,
Andy
 
T

Tim Meddick

Try the following in a batch-file :

------------------- copy between lines -------------------

@echo off
if EXIST %SystemRoot%\system32\spool\PRINTERS\*.* del
%SystemRoot%\system32\spool\PRINTERS\*.*


------------------- copy between lines -------------------

*NB the command starting ; "if" should be all on one line but may not
appear so due to line-wrap - ensure the command ends with the second
occurrence of ; "*.*"


However, this command may clear the print que, but will not cancel the
currently printing document as that has already been passes into the
printer's memory.

==

Cheers, Tim Meddick, Peckham, London. :)
 
T

Tim Meddick

Please ignore my previous post ;

The more accurate way of handling printer (spooler) functions is by the XP
built-in VBS scripts :

prncnfg.vbs
prndrvr.vbs
prnjobs.vbs
prnmngr.vbs
prnport.vbs
prnqctl.vbs

....which are located in your [system32] directory.


The one's you want (to stop printing and clear the que) are :
[prnjobs.vbs] and [prnqctl.vbs] and the syntax to place into a batch-file
would be :

------------------- copy between lines -------------------

@echo off
echo Cancelling current print job...
cscript prnjobs.vbs -x
echo Cancelling all print jobs...
cscript prnqctl.vbs -x

------------------- copy between lines -------------------

For usage instructions (syntax) for each of the prn[func].vbs scripts
included with XP, type the following at the command prompt ;

cscript prn[func].vbs /?

==

Cheers, Tim Meddick, Peckham, London. :)
 
M

Mint

Please ignore my previous post ;

The more accurate way of handling printer (spooler) functions is by the XP
built-in VBS scripts :

prncnfg.vbs
prndrvr.vbs
prnjobs.vbs
prnmngr.vbs
prnport.vbs
prnqctl.vbs

...which are located in your [system32] directory.

The one's you want (to stop printing and clear the que) are :
[prnjobs.vbs] and [prnqctl.vbs] and the syntax to place into a batch-file
would be :

------------------- copy between lines -------------------

@echo off
echo Cancelling current print job...
cscript prnjobs.vbs -x
echo Cancelling all print jobs...
cscript prnqctl.vbs -x

------------------- copy between lines -------------------

For usage instructions (syntax) for each of the prn[func].vbs scripts
included with XP, type the following at the command prompt ;

cscript  prn[func].vbs  /?

==

Cheers,    Tim Meddick,    Peckham, London.    :)


Is there a  way to delete everything in the printer queue using maybe
a batch file?
This would save paper and time.
I am sometimes at a computer where others walk away from it and there
are items in the printer queue.
Then when I print something, I have to wait while other pages come
out.
Thanks,
             Andy

Ran into some problemos.

Andy

C:\DELL>canc_print_jobs
Cancelling current print job...
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.

Unable to set print job Error 0x8004100C Not supported
Operation GetObject
Provider CIMWin32
Description
Win32 error code
Cancelling all print jobs...
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.

CScript Error: Loading script "C:\Windows
\System32\Printing_Admin_Scripts\en-US\
c:\windows\system32\prnqctl.vbs" failed (The filename, directory name,
or volume
label syntax is incorrect. ).


@echo off
echo Cancelling current print job...
cscript C:\Windows\System32\Printing_Admin_Scripts\en-US\prnjobs.vbs -
x
echo Cancelling all print jobs...
c:\cscript C:\Windows\System32\Printing_Admin_Scripts\en-US\c:\windows
\system32\prnqctl.vbs -x
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top