Registering WSC Objects
Although Windows Script Components (WSC) objects are made of scripting code, they’re COM objects. Discover how WSC objects appear as binary COM Automation objects to clients.
February 25, 2001
Although Windows Script Components (WSC) objects are made of scripting code, they're COM objects. They use a little trick to appear as binary COM Automation objects to clients. All WSC objects specify the same executable—scrobj.dll—in their HKEY_CLASSES_ROOTCLSIDInprocServer32 subkey. Thus, the registry forwards all clients calling about WSC objects to scrobj.dll, which is a system-provided binary COM object that exposes the IDispatchEx interface. Scrobj.dll, in turn, accepts and dispatches calls to a specific scripting file: the .wsc file that contains the component's functionality. The WSC-specific subkey HKEY_CLASSES_ROOTCLSIDclsidScriptletURL (where clsid is the WSC object's CLSID) establishes the link between the CLSID, scrobj.dll, and the .wsc file. This subkey contains the .wsc file's path. (To learn more about WSC objects, see the Web-exclusive article "Use WSC to Write Reusable Code," http://www.winscriptingsolutions.com, InstantDoc ID 16166. To see an example of how to write and use WSC, see Alistair G. Lowe-Norris, "Scripting Solutions with WSH and COM: Using WSC to Build a Progress Bar Dialog Box." This series appeared in four parts: September 2000, October 2000, January 2001, and February 2001.)
About the Author
You May Also Like