Defines objects in Windows Script (.wsf) files that can be referenced by a script.
|
---|
<object id="objID" {classid="clsid:GUID" | progid="progID"} [events="hookevents"] /> |
Arguments
- objID
Required. A name that references the object in your script. Object ID values must begin with a letter and can include letters, digits, and underscores (_). The object ID must be unique throughout the scope of the Windows Script file.
- GUID
Required unless progID is defined. The class ID (GUID) of the object.
- progID
Required unless GUID is defined. Program ID of the object, which can be specified as an alternative to the class ID.
- hookevents
Optional. A value (either "true" or "false") that determines if you can hook events from the object. By default, hookevents is false. If the attribute is true, you can connect to any events the object may fire. You must add an event handler for each event that is to be handled.
Remarks
Example
| Copy Code |
---|
<job>
<object id="fso" progid="Scripting.FileSystemObject"/>
<script language="Jscript">
var a = fso.CreateTextFile("c:\\testfile.txt", true);
a.WriteLine("This is a test.");
a.Close();
</script>
</job> |
See Also