Why re-invent the wheel? The console command schtasks.exe was written specifically for this purpose.Dear Exprt,
how to create task schedule one time on specific date.
vbscript Task schedule
April 22nd, 2014 6:47am
Dear Exprt,
how to create task schedule one time on specific date.
strComputer="."
SetobjWMIService=GetObject("winmgmts:"_
&"{impersonationLevel=impersonate}!\\"_
&strComputer&"\root\cimv2")
JobID="Test"
SetobjNewJob=objWMIService.Get("Win32_ScheduledJob")
errJobCreate=objNewJob.Create_
("Notepad.exe","********143000.000000-420",_
True,1,,True,JobId)
IferrJobCreate=0Then
WScript.Echo"Jobcreatedsuccessfully:"&VBNewLine_
&"Notepad.exescheduledtorunrepeatelyat14.30(2:30P.M.)PST"&VBNewLine_
&"onMon,Wed,andFri."
Else
WScript.Echo"Jobnotcreated.Errorcode="&errJobCreate
EndIf
Free Windows Admin Tool Kit Click here and download it now
April 22nd, 2014 1:35pm


