Compartir a través de


<reference> Element (Windows Script Host)

Includes a reference to an external type library.

                      <reference [object="progID"|guid="typelibGUID"] [version="version"] />

Arguments

  • progID
    Program ID from which the type library can be derived. It can include either a version number (for example, ADO.Recordset.2.0), the explicit program ID of a type library, or the program ID of the executable (such as a .DLL) that incorporates the type library. If you use the object attribute, you do not need to specify a version attribute because the version can be inferred from the program ID. If the object attribute is specified, you cannot also specify a GUID attribute.

  • typelibGUID
    The GUID of the type library to reference. If the GUID attribute is specified, you cannot also specify an object attribute.

  • version
    Optional. Version number of the type library to use. It must be in the form <major version>[.<minor version>]. If a version is not specified, the default version is 1.0. If the object attribute is used to specify the type library and the version is not specified, the version is derived from the registry key for the specified program ID. If none can be found, the default is 1.0.

Remarks

Referencing a type library in your Windows Script (.wsf) file enables you to use constants defined in the type library in your scripts. The <reference> element looks up and makes available the type library associated with a specific program ID or type library name. Type library information can be available in .tlb, .olb, or .dll files.

See Also

Reference

<runtime> Element (Windows Script Host)

<named> Element

<description> Element (Windows Script Host)

<example> Element

<object> Element (Windows Script Host)

<package> Element (Windows Script Host)