Jump to content

Recommended Posts

Posted (edited)

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
Posted

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ÍÁ½½±ÈÅÕ½Ðì¤
Posted

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.

Posted

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?

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
  • Recently Browsing   0 members

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