CreateObject

Method of IWScript

Creates a COM object

  • BSTR strProgID
  • BSTR strPrefix = "" (optional)

Return Value

JavaScript

var ppObject = WScript.CreateObject(strProgID, strPrefix);

Visual Basic Script

ppObject = WScript.CreateObject strProgID, strPrefix

C++

CComPtr<IDispatch> pObject;
HRESULT hr = WScript.CreateObject(strProgID, strPrefix, &pObject);