Jump to content

Script to pause a printer


bben92
 Share

Recommended Posts

You would need to stop the print spooler or pause it depending on what your goal is. If you want to clear stuck jobs, clear it by using the first example. If you just really want to pause it, then look at the second example. To restart it, use the third example.

The following script would clear all scheduled jobs. It does this by deleting all files from a directory after the spooler has stopped.

#include <Process.au3>
SplashTextOn("", "Stopping Print Spooler, please wait...", 150, 75)
_RunDOS("NET STOP spooler")
SplashOff()
SplashTextOn("", "Clearing stuck print jobs, please wait...", 150, 75)
sleep(2000)
FileDelete(@SystemDir & "\spool\PRINTERS\*.*")
SplashOff()
SplashTextOn("", "Starting Print Spooler, please wait...", 150, 75)
_RunDOS("NET START spooler")
SplashOff()
MsgBox(64, "Done!", "Done", 3)oÝ÷ Ù«­¢+Ù}IÕ¹=L ÅÕ½Ðí9PAUMÍÁ½½±ÈÅÕ½Ðì¤oÝ÷ Ù«­¢+Ù}IÕ¹=L ÅÕ½Ðí9PMQIPÍÁ½½±ÈÅÕ½Ðì¤
Edited by Volly
Link to comment
Share on other sites

If you're on XP you might check out: http://technet.microsoft.com/en-us/library/bb490976.aspx

XP comes with 6 printer-related .vbs scripts in the C:\Windows\System32 folder that work pretty spiffy, the prnqctl.vbs one in particular looks like it has a -z flag to indicate that you want to pause printing, and a -m flag to resume.

Edited by exodius
Link to comment
Share on other sites

On the printer control panel, when you right click on the printer you can click on "suspend".

That is what I need to do.

Thanks for your answer.

Benoit.

You would need to stop the print spooler or pause it depending on what your goal is. If you want to clear stuck jobs, clear it by using the first example. If you just really want to pause it, then look at the second example. To restart it, use the third example.

The following script would clear all scheduled jobs. It does this by deleting all files from a directory after the spooler has stopped.

#include <Process.au3>
SplashTextOn("", "Stopping Print Spooler, please wait...", 150, 75)
_RunDOS("NET STOP spooler")
SplashOff()
SplashTextOn("", "Clearing stuck print jobs, please wait...", 150, 75)
sleep(2000)
FileDelete(@SystemDir & "\spool\PRINTERS\*.*")
SplashOff()
SplashTextOn("", "Starting Print Spooler, please wait...", 150, 75)
_RunDOS("NET START spooler")
SplashOff()
MsgBox(64, "Done!", "Done", 3)oÝ÷ Ù«­¢+Ù}IÕ¹=L ÅÕ½Ðí9PAUMÍÁ½½±ÈÅÕ½Ðì¤oÝ÷ Ù«­¢+Ù}IÕ¹=L ÅÕ½Ðí9PMQIPÍÁ½½±ÈÅÕ½Ðì¤
Link to comment
Share on other sites

Exodius, the script prnqctl.vbs is exactly what I need, but it does not work with Windows 2000...

Regards.

Benoit.

If you're on XP you might check out: http://technet.microsoft.com/en-us/library/bb490976.aspx

XP comes with 6 printer-related .vbs scripts in the C:\Windows\System32 folder that work pretty spiffy, the prnqctl.vbs one in particular looks like it has a -z flag to indicate that you want to pause printing, and a -m flag to resume.

Link to comment
Share on other sites

Volly,

I don't want to stop the Print Spooler, but only pause 1 printer.

Thank you very much for your answer.

Benoit.

What I told you will do just that. You are simply doing command line to do it. Have you tested what I sent you?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...