Creates a COM object.

CreateObject(strProgID, strPrefix):

Objects created with the CreateObject 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.
strProgID
String value indicating the programmatic identifier (ProgID) of the object you want to create. Also: You can use the CLSID.
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).:
// File: create_object.w_js (JScript)
var oIE = System.CreateObject("InternetExplorer.Application","EventIE_");
    oIE.Toolbar = 0;  

    // Show the "blank" page
    oIE.navigate("about:blank");
    oIE.Visible = 1;


function EventIE_OnQuit() {
   Window.Delete(1);
   Window.TextOut(1, 50, 50, "EventIE_OnQuit");
   Window.UpdateWindow();
};
'VBScript
Dim oIE
Set oIE = System.CreateObject("InternetExplorer.Application", "EventIE_")
    oIE.Toolbar = 0

    'Show the "blank" page
    oIE.navigate("about:blank")
    oIE.Visible = 1


Function EventIE_OnQuit() 
   Window.Delete 1
   Window.TextOut 1, 50, 50, "EventIE_OnQuit"
   Window.UpdateWindow
End Function
Notes: You can create the COM object without the event sinks.
JScript (.w_js)
var obj = new ActiveXObject("InternetExplorer.Application");
VBScript (.w_vbs)
Dim obj
Set obj = CreateObject("InternetExplorer.Application")
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.