Cancel all printer jobs

  • Thread starter Thread starter gokcey
  • Start date Start date
G

gokcey

Hi,
My computer's operating system is Windows 2000. I need to cancel al
jobs on
printer. For this reason I have written a script code below:

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
"{impersonationLevel=imper
sonate}!\\" & strComputer & "\root\cimv2")
Set colInstalledPrinters = objWMIService.ExecQuery _
("Select * from Win32_PrinterConfiguration")
For Each objPrinter in colInstalledPrinters
If objPrinter.Name = "Xerox DocuPrint N2125" Then
objPrinter.CancelAllJobs()
End If
Wscript.Echo "Name: " & objPrinter.Name
Next

However, When I run this script, I get an error like below:
Microsoft VBScript runtime error: Object doesn't support thi
property
or method: 'objPrinter.CancelAllJobs'

Is this because the operating system is Windows 2000.
What can I do to cancel all jobs in my printer using code?
Thanks in advance


-
gokce
 
Hi, you need to use Win32_Printer, not Win32_PrinterConfiguration

--
Felix Maxa
Microsoft Printing, Imaging and Fax Team
This posting is provided "AS IS" with no warranties, and confers no rights.
Please do not send email directly to this alias. This alias is for newsgroup
purposes only.
 
Back
Top