Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add/Delete a scheduled task in XP

Status
Not open for further replies.

khaledocom

Technical User
Jan 25, 2011
3
QA
Dear friends,

Please help me to do the above.
The following is the code I wrote to add but it didn't work.

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objNewJob = objWMIService.Get("Win32_ScheduledJob")errJobCreated = objNewJob.Create _
("C:\222\test.xls", "********073000.000000-420", _
True , 1 Or 2 Or 4 Or 8 Or 16, 32 ,64 , JobID)
Wscript.Echo errJobCreated


Please correct it and give me another code to delete same task.

Thanks in advance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top