Поделиться через


Execute Method (Windows Script Host) 

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).

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:

WshRemote Object

See Also

Reference

WshController Object
Status Property (WshRemote)
Error Property (WshRemote)
Terminate Method (WshScriptExec)
Start Event
End Event