Reports the current status of the remote script.
Object.Status |
Arguments
- Object
-
WshRemote object.
Remarks
The Status property returns a read-only enumerated data type.
Values
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. |
Example
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.
Visual Basic Script | Copy Code |
---|---|
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 |
JScript | Copy Code |
---|---|
var Controller = WScript.CreateObject("WSHController"); var RemoteScript = Controller.CreateScript("test.js", "remoteserver"); RemoteScript.Execute(); while (RemoteScript.Status != 2) { WScript.Sleep(100); } |