Defines information used to register the script component as a COM component.
<registration progid="progID" classid="GUID" description="description" version="version" [remotable=remoteFlag]/>
or
<registration progid="progID" classid="GUID" description="description" version="version" [remotable=remoteFlag]> <script> (registration and unregistration script) </script> </registration>
Set Component = CreateObject("Component.MyComponent")
Note Although a progid attribute is optional, you must include either a progid or a classid attribute (you can include both). If only the progid attribute is specified, the class ID is generated automatically. If only the class ID is created, then no progid is registered and the object can be created only by referencing the class ID directly.
Note The registration attributes can appear in any order in the <registration> element.
After a script component is created, it can be registered using a program such as Regsvr32.exe, which reads the information in the <registration> element and writes it into the computer's Windows Registry. For example, a script component can be registered this way:
regsvr32 file:\\myserver\MyComponent.wsc
Note A <registration> element is not required in all cases. For example, a script component that implements the DHTML Behaviors interface handler in Microsoft® Internet Explorer 5.0 does not need to be registered, because Internet Explorer registers the behaviors as they are detected on the page. For details about registration requirements, see the documentation for the interface handler you are implementing and note also which host the script component will be used in.
If you do not include class ID information, the registration program assigns a class ID to your script component at the time it is registered. However, the script component will have a different class ID everywhere it is registered. It is highly recommended that you provide a class ID for the script component yourself, to ensure that your script component has the same class ID on all computers on which it is registered.
Allowing the registration program to create a class ID can cause problems if you use the script component with development tools that store class IDs. If the registration creates a new class ID each time, it will not match the the ID stored by the application.
You can optionally run scripts when a script component is registered and unregistered. To do so, include a <script> element within the <registration> element. To run script during registration, write a register( ) function. To run script when the script component has been unregistered, include an unregister( ) function.
The following shows a typical <registration> element that includes both a prog ID and a class ID.
<registration progid="Component.TestScript" classid="{2154c700-9253-11d1-a3ac-0aa0044eb5f}" description="My Test Component" version="1"/>
The following registration element allows the script component to be instantiated via DCOM:
<registration> progid="Component.TestScript" classid="{2154c700-9253-11d1-a3ac-0aa0044eb5f}" version="1" description="My Test Component" remotable=true/>
The following example shows a <registration> element that includes script to be run when the script component is registered and unregistered.
Note A CDATA section is required to make the script in the <script> element opaque. For details, see Script Component Files and XML Conformance.
<registration progid="Component.TestScript" classid="{2154c700-9253-11d1-a3ac-0aa0044eb5f}"> version="1" description="My Test Component"> <script language="VBScript"> Function register() MsgBox "Component 'My Test Component' registered." End Function Function unregister() MsgBox "Component 'My Test Component' unregistered." End Function </script> ]]> </registration>
Creating Registration Information | Registering a Script Component