GetObject

Method of IWScript

Retrieves an existing object with the specified ProgID, or creates a new one from a file

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

Return Value

JavaScript

var ppObject = WScript.GetObject(strPathName, strProgID, strPrefix);

Visual Basic Script

ppObject = WScript.GetObject strPathName, strProgID, strPrefix

C++

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