Export (0) Print
Expand All
Expand Minimize

Status Property (WshRemote)

Reports the current status of the remote script.

                      Object.Status

Object

WshRemote object.

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);
}

Applies To:

Community Additions

ADD
Show:
© 2014 Microsoft