Execute Method (Windows Script Host)
Starts execution of a remote script object.
object.Execute
- object
WshRemote Object
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).
The following example demonstrates how the Execute method is used to create a WshRemote object (start an instance of a remote script).
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
var Controller = WScript.CreateObject("WSHController");
var RemoteScript = Controller.CreateScript("remote1.js");
RemoteScript.Execute();
while (RemoteScript.Status != 2) {
WScript.Sleep(100);
}