Windows Script Host  

Execute Method

Starts execution of a remote script object.

object.Execute

Parameters

object
WshRemote Object

Remarks

The Start event of the WshRemote object is fired when the script starts executing. Do not confuse the Execute method with the Exec method (of the WScript object).

Example

The following example demonstrates how the Execute method is used to create a WshRemote object (start an instance of a remote script).

[VBScript]
Dim Controller, RemoteScript
Set Controller = WScript.CreateObject("WSHController")
Set RemoteScript = Controller.CreateScript("remote1.js")
RemoteScript.Execute

Do While RemoteScript.Status <> 2 
    WScript.Sleep 100
Loop
[JScript]
var Controller = WScript.CreateObject("WSHController");
var RemoteScript = Controller.CreateScript("remote1.js");
RemoteScript.Execute();

while (RemoteScript.Status != 2) {
    WScript.Sleep(100);
}

See Also

WshController Object | WshRemote Object | Status Property | Error Property | Terminate Method | Start Event | End Event