Execute Method (Windows Script Host)
Starts execution of a remote script object.
Syntax
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).
Legacy Code Example
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);
}
Applies To:
See Also
WshController Object
Status Property (WshRemote)
Error Property (WshRemote)
Terminate Method (WshScriptExec)
Start Event
End Event