Cancel all printer jobs

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: gokcey (gokcey.128gik_at_mail.mcse.ms)
Date: 02/26/04


Date: Thu, 26 Feb 2004 05:23:34 -0600


Hi,
My computer's operating system is Windows 2000. I need to cancel all
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 this
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.

--
gokcey
------------------------------------------------------------------------
Posted via http://www.mcse.ms
------------------------------------------------------------------------
View this thread: http://www.mcse.ms/message427844.html
 


Relevant Pages

  • Re: HP deskjet 722c on Windows XP
    ... it on this computer with Windows XP, ... jobs are going into the taskbar. ... Cari (MS-MVP) wrote: ...
    (microsoft.public.windowsxp.print_fax)
  • Re: Heirs of wealthy Hells Angel fight court battle- CanWest News
    ... If you'll fire Bonita's realm with jobs, ... cancel the thinking. ...
    (rec.ponds)
  • Re: Problems printing older DOS program in Windows XP
    ... The other consideration might be whether it is possible that the server ... You do not say whether when this issue arises, the workstation can ... I am having a problem printing in Windows XP workstations from an older DOS ... all jobs are dumped to the printer as Windows exits and the jobs print. ...
    (comp.periphs.printers)
  • Re: print job stuck in que for printer hp psc 1410 all in one prin
    ... How to cancel printing or to delete a print job that is stuck in the print ... Windows Printing Team ...
    (microsoft.public.windowsxp.print_fax)
  • Re: Steve Jobs has died
    ... I don't know what you mean by "cheap" but I stand by it, ... I've not "adored" Steve Jobs, and I've not claimed he was the greatest ... Steve Jobs was the Ralph Lauren of the computer world. ... code of those early Windows releases) and I'd trace that right back to ...
    (uk.legal)