Script for run script on vbs

Posted by user35729 on Super User See other posts from Super User or by user35729
Published on 2010-05-18T06:35:08Z Indexed on 2010/05/18 6:41 UTC
Read the original article Hit count: 579

Filed under:
|

Hello everybody I have a script on vbscript Dim WSHShell, WinDir, Value, wshProcEnv, fso, Spath

Set WSHShell = CreateObject("WScript.Shell")

Dim objFSO, objFileCopy Dim strFilePath, strDestination

Const OverwriteExisting = True Set objFSO = CreateObject("Scripting.FileSystemObject") Set windir = objFSO.getspecialfolder(0) objFSO.CopyFile "\dv.rt.ru\SYSVOL\DV.RT.RU\scripts\shutdown.vbs", windir&"\", OverwriteExisting

strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\" _ & strComputer & "\root\cimv2") JobID = "1"

Set colScheduledJobs = objWMIService.ExecQuery _ ("Select * from Win32_ScheduledJob") For Each objJob in colScheduledJobs objJob.Delete Next

Set objNewJob = objWMIService.Get("Win32_ScheduledJob") errJobCreate = objNewJob.Create _ (windir & "\shutdown.vbs", "**093000.000000+660", _ True, 1 OR 2 OR 4 OR 8 OR 16 OR 32 OR 64, ,True, JobId)

How make that shutdown.vbs not run once at 9:30 but run for 9:30 to 12:00

© Super User or respective owner

Script for run script on vbs

Posted by user31568 on Server Fault See other posts from Server Fault or by user31568
Published on 2010-05-18T06:33:25Z Indexed on 2010/05/18 6:41 UTC
Read the original article Hit count: 579

Filed under:
|

Hello everybody I have a script on vbscript

Dim WSHShell, WinDir, Value, wshProcEnv, fso, Spath

Set WSHShell = CreateObject("WScript.Shell")

Dim objFSO, objFileCopy
Dim strFilePath, strDestination

Const OverwriteExisting = True
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set windir = objFSO.getspecialfolder(0)
objFSO.CopyFile "\dv.rt.ru\SYSVOL\DV.RT.RU\scripts\shutdown.vbs", windir&"\", OverwriteExisting

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\" _
& strComputer & "\root\cimv2")
JobID = "1"

Set colScheduledJobs = objWMIService.ExecQuery _
("Select * from Win32_ScheduledJob")
For Each objJob in colScheduledJobs
objJob.Delete
Next

Set objNewJob = objWMIService.Get("Win32_ScheduledJob")
errJobCreate = objNewJob.Create _
(windir & "\shutdown.vbs", "**093000.000000+660", _
True, 1 OR 2 OR 4 OR 8 OR 16 OR 32 OR 64, ,True, JobId)

How make that shutdown.vbs not run once at 9:30 but run for 9:30 to 12:00

© Server Fault or respective owner

Related posts about vbscript

Related posts about scheduled-tasks