‎11-07-2008 12:16 AM
If Wscript.Arguments.Count = 0 Then
strComputer = "."
else
strComputer = Wscript.Arguments(0)
end if
strCommand = "notepad.exe"
Const INTERVAL = "n"
Const MINUTES = 1
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set objScheduledJob = objWMIService.Get("Win32_ScheduledJob")
Set objSWbemDateTime = CreateObject("WbemScripting.SWbemDateTime")
objSWbemDateTime.SetVarDate(DateAdd(INTERVAL, MINUTES, Now()))
errReturn = objScheduledJob.Create(strCommand, objSWbemDateTime.Value, False, 0, 0, True, intJobID)
If errReturn = 0 Then
Wscript.Echo "Notepad was started with a process ID: " & intJobID
Else
Wscript.Echo "Notepad could not be started due to error: " & errReturn
End If
\\server\share\script.vbs {computer}
‎11-07-2008 03:52 AM
‎11-07-2008 03:31 AM
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now