Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Error Event

Event that is fired when an error occurs in the remote script.



WshRemote object.

The remote script object fires the Error event when the remote script terminates prematurely. The Error property contains the WshRemoteError object (which holds information about the error that caused the remote script to terminate prematurely).

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

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");

Applies To:

Community Additions

© 2015 Microsoft