VBS Script To Cancel All Active Print Jobs On A Local Machine

 

This By Request Vbs script will cancel all of the active print jobs on the computer from which the script is executed on.

 

VBS Script:

 

strComputer = "LocalHost"

 

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

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

 

For Each objItem in colItems

objItem.CancelAllJobs

Next

 

MsgBox "Done"

 

 

Published Sunday, January 27, 2008 12:53 PM by dhite
Filed under:

Comments

No Comments