VB printer script

bristow

New Member
Hi,

Does anyone know if it would be possilble to create a script to delete jobs from a printer que depeding on what its status is?

Thanks!
 
Want i need it to be able to do is search through a list of printers queue's and search for jobs that have the status "error" and once it has found them delete them. Does anyone know if this is possible? Or if there is another way to do this? Basicaly I just want to work out if theres a way to stop printer queues being held up by jobs that have came up with errors.

Thanks.
 
What I have so far is this,

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colInstalledPrinters = objWMIService.ExecQuery _
("Select * from Win32_Printer")

For Each objPrinter in colInstalledPrinters
objPrinter.CancelAllJobs()
Next



That manages to delete all printer jobs, from all printers, but does anyone know how i can now go about just deleting printing jobs that have came up with errors?

Thanks.
 
net stop spooler
del c:\windows\system32\spool\printers\*.* /q
net start spooler


Then use Bat2VBS tool (hmm I had this somewhere, but oh well the above batch file will work ;))
 
"d" is not a post
And this is one of the reasons why I replied
If you feel you need to reply to yourself - don't, instead use "Edit" if yours is the last post in the thread (presently not)

Creating a batch file, then running bat2vbs, may be the easiest thing to do here for you
I would like to hear the end result myself.
 
Kimsland,

Ah that would have been an easier way do go about it lol. Do you have any idea how I could now filter out and delete jobs that have came up with errors? I have looked in the spool\printers folder to see if there is any difference between the files in there, but i cant seem to find one.

Thanks.
 
Ah that would have been an easier way do go about it lol. Do you have any idea how I could now filter out and delete jobs that have came up with errors?
Only by reading a log through Windows logs
I wonder if there is a script for that?
Actually there must be, because printer programs show us the error (usually audibly these days)

No idea how to write a script for that though
 
Back
Top