Hello all,
Just a quick question - what's a good way to disable a task in task
scheduler? There's a task that runs, and if it fails they want me to diable
it until they can work on it - so right off the bat I'm exactly sure where I
should look for this, if it even exists. Any ideas? Thanks!

Re: Disabling task scheduler by Gabriel

Gabriel
Fri Jan 28 15:03:37 CST 2005

I think you can do it...


strComputer = "localhost"
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
REM Set colProcessList = objWMIService.ExecQuery ("Select * from
Win32_Process Where Name = 'msnmsgr.exe'")
Set colProcessList = objWMIService.ExecQuery ("Select * from
Win32_Process")
For Each objProcess in colProcessList
If MsgBox("Terminate: " & objprocess.name,vbQuestion +
vbYesNo,"Yes")=vbYes then
objProcess.Terminate()
MsgBox("OK")
End if
Next


Complete Documentation at:


http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wmi_tasks__computer_hardware.asp

Gabriel.


"Jeremy D Pavleck" <nospam_jpavleck@Gmail.com> escreveu na mensagem
news:%233ysJ%23WBFHA.3596@TK2MSFTNGP12.phx.gbl...
> Hello all,
> Just a quick question - what's a good way to disable a task in task
> scheduler? There's a task that runs, and if it fails they want me to
> diable
> it until they can work on it - so right off the bat I'm exactly sure where
> I
> should look for this, if it even exists. Any ideas? Thanks!
>
>



Re: Disabling task scheduler by Bill

Bill
Fri Jan 28 23:47:52 CST 2005

How is that going to help for disabling a specific scheduled task?

--=20

Bill James
Microsoft MVP - Shell/User

Windows VBScript Utilities =BB www.billsway.com/vbspage/
Windows Tweaks & Tips =BB www.billsway.com/notes_public/

"Gabriel South" <gsouth@hotmail.com> wrote in message =
news:uGouuQXBFHA.3528@tk2msftngp13.phx.gbl...
>I think you can do it...
>=20
>=20
> strComputer =3D "localhost"
> Set objWMIService =3D GetObject("winmgmts:\\" & strComputer & =
"\root\cimv2")
> REM Set colProcessList =3D objWMIService.ExecQuery ("Select * from=20
> Win32_Process Where Name =3D 'msnmsgr.exe'")
> Set colProcessList =3D objWMIService.ExecQuery ("Select * from=20
> Win32_Process")
> For Each objProcess in colProcessList
> If MsgBox("Terminate: " & objprocess.name,vbQuestion +=20
> vbYesNo,"Yes")=3DvbYes then
> objProcess.Terminate()
> MsgBox("OK")
> End if
> Next
>=20
>=20
> Complete Documentation at:
>=20
>=20
> =
http://msdn.microsoft.com/library/default.asp?url=3D/library/en-us/wmisdk=
/wmi/wmi_tasks__computer_hardware.asp
>=20
> Gabriel.
>=20
>=20
> "Jeremy D Pavleck" <nospam_jpavleck@Gmail.com> escreveu na mensagem=20
> news:%233ysJ%23WBFHA.3596@TK2MSFTNGP12.phx.gbl...
>> Hello all,
>> Just a quick question - what's a good way to disable a task in task
>> scheduler? There's a task that runs, and if it fails they want me to=20
>> diable
>> it until they can work on it - so right off the bat I'm exactly sure =
where=20
>> I
>> should look for this, if it even exists. Any ideas? Thanks!
>>
>>=20
>=20
>