Re: WMI . PRINT JOIB DELETIION

From: Jiachuan Wang [MSFT] (jiawang_at_online.microsoft.com)
Date: 03/22/04


Date: Mon, 22 Mar 2004 10:26:14 -0800

one thing to note:The "Delete" method support Requires Windows XP or Windows
Server 2003

-- 
This posting is provided "AS IS" with no warranties, and confers no rights.
"Sarika Sharma[MSFT]" <sarikas@online.microsoft.com> wrote in message
news:%23lGnyTDEEHA.2652@TK2MSFTNGP10.phx.gbl...
> set Service  = GetObject("winmgmts:\\.\root\cimv2")
> set oJob = Service.Get("\\.\root\cimv2:Win32_PrintJob.Name=""" & printjob
&
> """")
> uResult = oJob.Pause()
> oJob.Delete_()
>
> This will pause the job you are interested in and delete its instance.
This
> should give you what you want .
>
> replace printjob with the name of the job you want to delete . Hope this
> helps. I have not tested this vb script, though
> -- 
> Sarika Sharma [MSFT]
> WMI Test Engineer
> This posting is provided "As Is" with no warranties, and confers no
rights.
> Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
> Please do not send e-mail directly to this alias. This alias is for
> newsgroup purposes only.
>
>
>
>
>
> "MQASIM" <mqasimhit@hotmail.com> wrote in message
> news:1AAA06B0-0B88-465C-AF59-2D01A47BD4CE@microsoft.com...
> > could some one please help .......
> > i wish to delete a printjob through WMI code........
> > i cannot do it as im a kiddo to WMI and i dont know how to do it .....
> > one thing more that i found might help some expert concentrate or find
out
> the solution for me ... is that Win32_PrintJob doesn't provide any method
> for delete()
> > so... i cant do it ...but u guys out there, im sure know the answer....
so
> plz help
> > it could be an unsafe code of C# or vb sample anything will help...
> > Hearteous Gratitude in advance....
> > THANX ALOT !
>
>


Relevant Pages