Windows Script Host  

End Event

Event that is fired when the remote script completes.

Object_end

Parameters

object
WshRemote object.

Remarks

The End event is fired when the remote script object has finished executing. This can be when the remote script object has terminated normally, timed out, or terminated due to an error.

Example

var WshController = new ActiveXObject("WSHController");
var RemoteProc = WshController.CreateScript("foo.wsf", "remotemachine");
WScript.ConnectObject(RemoteProc, "RemoteProc_");
var Done = false;
RemoteProc.Execute();
while (!Done)
   WScript.Sleep(100);

function RemoteProc_End()
{
   WScript.Echo("The process has ended");
   Done = true;
}

function RemoteProc_Error()
{
   WScript.Echo("An error has occurred: " + RemoteProc.Error.Description);
   Done = true;
}

function RemoteProc_Start()
{
   WScript.Echo("The process has started");
}

See Also

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