Creates a COM object from a file.

GetObject(LoadedModuleID, clsid, strPrefix):

Returns a reference to an Automation object from a file. Objects created with the GetObject method using the strPrefix argument are connected objects.

These are useful when you want to sync an object's events. The object's outgoing interface is connected to the script file after the object is created. Event functions are a combination of this prefix and the event name.

LoadedModuleID
The return value System.LoadLibrary(path_to_library) - .ocx, .dll, .exe module.
clsid
({...})A CLSID is a globally unique identifier that identifies a COM class object. (You can use the PROGID.)
strPrefix
String value indicating the "callback" function prefix. Can be empty string.
Here's an example that creates a COM object (with outgoing methods - events).:
//JScript
var id = System.LoadLibrary("activex.dll");
var obj = System.GetObject(id, "{9ACBF10A-ECE2-4F01-905B-1384EC0F8206}", "prefix");

    obj.HelloWorld("DDD", 64);

//System.FreeLibrary(id);
'VBScript
Dim obj, id
    id = System.LoadLibrary("activex.dll")
Set obj = System.GetObject(id, "{9ACBF10A-ECE2-4F01-905B-1384EC0F8206}", "prefix")

    obj.HelloWorld "DDD", 64

'System.FreeLibrary(id)
content
The advanced scripting shell. It is not wscript.exe!
JScript and VBScript are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.