Dim strArgs, strCmd, strEngine, i, objDebug, wshShell
Set wshShell = CreateObject( "WScript.Shell" )
strEngine = UCase( Right( WScript.FullName, 12 ) )
If strEngine <> "\CSCRIPT.EXE" Then
' Recreate the list of command line arguments
strArgs = ""
If WScript.Arguments.Count > 0 Then
For i = 0 To WScript.Arguments.Count - 1
strArgs = strArgs & " " & WScript.Arguments(i)
Next
End If
' Create the complete command line to rerun this script in CSCRIPT
strCmd = "CSCRIPT.EXE //NoLogo """ & WScript.ScriptFullName & """" & strArgs
' Rerun the script in CSCRIPT
Set objDebug = wshShell.Exec( strCmd )
' Wait until the script exits
Do While objDebug.Status = 0
WScript.Sleep 100
Loop
' Exit with CSCRIPT's return code
WScript.Quit objDebug.ExitCode
End If
Set oLocator = CreateObject("WbemScripting.SWbemLocator")
Set oServices = oLocator.ConnectServer( , "root\ccm\invagt")
wscript.sleep 3000
Set objShell = CreateObject("Wscript.Shell")
objShell.Run "control smscfgrc", 1, True
wscript.sleep 3000
Set cpApplet = CreateObject("CPAPPLET.CPAppletMgr")
Set actions = cpApplet.GetClientActions
For Each action In actions
action.PerformAction
wscript.Echo action.Name
Next
wscript.Echo "-----------------------------------"
wscript.Echo "Actions was run at: " & Now()
wscript.Echo "-----------------------------------"
Dim objResult
Set objShell = WScript.CreateObject("WScript.Shell")
wscript.Echo ""
wscript.Echo "(Close the window for exit)"
Do While True
For i = 1 To 60 Step 1
objResult = objShell.sendkeys("{numlock}{numlock}")
Wscript.echo "NoLock start: " & Time()
Wscript.Sleep (60000)
Next
For Each action In actions
action.PerformAction
wscript.Echo action.Name
Next
wscript.Echo "-----------------------------------"
wscript.Echo "Actions was run at: " & Now()
wscript.Echo "-----------------------------------"
Loop