Thursday, September 27, 2007

VBScript Running Scripts on Remote Computers

'Script Start


'Substitute server

strRemoteComputer = "servername"

'Substitute script name

strWorkerScript = "scripttorunonremote.vbs"
Set objWshController = WScript.CreateObject("WshController")
Set objRemoteScript = objWshController.CreateScript(strWorkerScript, strRemoteComputer)
objRemoteScript.Execute

Do While Not objRemoteScript.Status = 2
Wscript.Sleep(100)
Wscript.Echo "Remote script not yet complete."
Loop




'Script End



How to execute a VBScript

No comments: