Reports the current status of the remote script.
Object.Status
The Status property returns a read-only enumerated data type.
The Status property returns one of three possible values.
Return Value | Numeric value | Description |
---|---|---|
NoTask | 0 | The remote script object has been created but has not yet executed. |
Running | 1 | The remote script object is currently running. |
Finished | 2 | The remote script object has finished running. |
The following JScript code demonstrates how to use the Status property in a test block that checks to see if a remote script terminated normally.
Dim Controller, RemoteScript
Set Controller = WScript.CreateObject("WSHController")
Set RemoteScript = Controller.CreateScript("test.js", "remoteserver")
RemoteScript.Execute
Do While RemoteScript.Status
<> 2
WScript.Sleep 100
Loop
var Controller = WScript.CreateObject("WSHController");
var RemoteScript = Controller.CreateScript("test.js", "remoteserver");
RemoteScript.Execute();
while (RemoteScript.Status
!= 2) {
WScript.Sleep(100);
}
WshController Object | WshRemote Object | Error Property | Execute Method | Terminate Method | Start Event | End Event | Error Event