Microsoft® Windows® Script Host
CreateObject Method
WSH Reference
Version 1

See Also                      Applies To


Description
Creates an object specified by the strProgID parameter.
Syntax
object.CreateObject(strProgID[,strPrefix])
Parameters
Part Description
object WScript object.
strProgID The program ID of the object to create.
strPrefix Optional.
Remarks
If the parameter strPrefix is specified, Windows Script Host connects the object's outgoing interface to the script file after creating the object. When the object fires an event, Windows Script Host calls a subroutine whose name consists of strPrefix and the event name. For example, if strPrefix is "MYOBJ_" and the object fires an event named "OnBegin," Windows Script Host calls the "MYOBJ_OnBegin" subroutine located in the script.

Example
The following example uses the CreateObject method to create a WshNetwork object:
Set WshNetwork = WScript.CreateObject("WScript.Network")