Windows Script

 

Windows Script is a comprehensive scripting infrastructure for the Microsoft® Windows® platform. Windows Script provides two script engines, Visual Basic® Scripting Edition and Microsoft JScript®, which can be embedded into Windows Applications. It also provides an extensive array of supporting technologies that makes it easier for script users to script Windows applications.

 

Script Runtime

 

A Dictionary object is the equivalent of a PERL associative array. Items can be any form of data, and are stored in the array. Each item is associated with a unique key. The key is used to retrieve an individual item and is usually an integer or a string, but can be anything except an array.

 

The FileSystemObject (FSO) object model allows you to use the familiar object.method syntax with a rich set of properties, methods, and events to process folders and files.

 

Script Encoder is a simple command-line tool that enables script designers to encode their final script so that Web hosts and Web clients cannot view or modify their source.

 

Script Control

 

The Script control provides a simple way for your application to host a scripting environment. Supported scripting languages are VBScript, JavaScript, and any other compliant scripting language that will work with the Microsoft Internet Explorer web browser.

 

You can download the script control from the following Web site: Windows Script Control

 

This page also provides a link to documentation on how to use the control. The file name you will receive is sct10en.exe.

 

VBScript Regular Expressions

 

Provides simple regular expression support.

 

Script Signer Control

 

Enables an author to sign a script with a digital signature and a recipient to verify the signature's authenticity and trustworthiness. Requires a valid certificate.

 

Windows Script Interfaces

 

Microsoft Windows Script Interfaces introduce a new way for an application to add scripting and OLE Automation capabilities.

 

The IActiveScript interface provides the methods necessary to initialize the scripting engine. The scripting engine must implement the IActiveScript interface.

 

An object implementing the IActiveScriptError interface is passed to the IActiveScriptSite.OnScriptError method whenever the scripting engine encounters an unhandled error. The host then calls methods on this object to obtain information about the error that occurred.

 

If the Windows Script engine allows raw text code scriptlets to be added to the script or allows expression text to be evaluated at run time, it implements the IActiveScriptParse interface. For interpreted scripting languages that have no independent authoring environment, such as VBScript, this provides an alternate mechanism (other than IPersist*) to get script code into the scripting engine, and to attach script fragments to various object events.

 

The IActiveScriptParseProcedure interface allows the source code text for procedures to be added to the script. For interpreted scripting languages that have no independent authoring environment, such as VBScript, this provides an alternate mechanism (other than IActiveScriptParse or IPersist*) to add script procedures to the namespace.

 

The IActiveScriptSite interface is implemented by the host to create a site for the Windows Script engine. Usually, this site will be associated with the container of all the objects that are visible to the script (for example, the ActiveX Controls). Typically, this container will correspond to the document or page being viewed. Microsoft Internet Explorer, for example, would create such a container for each HTML page being displayed. Each ActiveX control (or other automation object) on the page, and the scripting engine itself, would be enumerable within this container.

 

The IActiveScriptSiteInterruptPoll interface allows a host to specify that a script should terminate.

 

The IActiveScriptSiteUIControl interface contains a method that allows you to selectively suppress the display of user interface (UI) prompts from the InputBox Function or the MsgBox Function. Implementation of this interface is optional for the host and currently applies only to an engine running VBScript.

 

The IActiveScriptSiteWindow interface is implemented by hosts that support a user interface on the same object as IActiveScriptSite . Hosts that do not support a user interface, such as servers, would not implement the IActiveScriptSiteWindow interface. The scripting engine accesses this interface by calling QueryInterface from IActiveScriptSite.

 

The IActiveScriptStats interface allows a host to query the statistics of a running script. The host can use this information to determine if script has taken too long to complete.

 

The IBindEventHandler interface enables the caller to provide an object that handles a specified event handler.

 

Windows Script Host

 

Windows Script Host (WSH) is a Windows administration tool.

 

Windows Script Host provides several objects for direct manipulation of script execution, as well as helper functions for other actions. Using these objects and services, you can accomplish tasks such as the following:

 

Print messages to the screen
Run basic functions such as CreateObject and GetObject
Map network drives
Connect to printers
Retrieve and modify environment variables
Modify registry keys

 

Windows Script Host is built into Microsoft Windows 98, 2000, and Millennium Editions. If you are running Windows 95, you can download Windows Script Host 5.6 from the Microsoft Windows Script Technologies Web site.

 

Capabilities Provided by the IWshShell Interface

 

Category

Method or Property

Running Programs

Run, Exec

Working with Special Folders

SpecialFolders

Working with Shortcuts

CreateShortcut

Working with Environment Variables

Environment, ExpandEnvironmentStrings

Working with the Event Log

LogEvent

Working with the Registry

RegRead, RegWrite, RegDelete

Sending Keystrokes to an Application

AppActivate, SendKeys

Obtaining a Scripts Current Directory

CurrentDirectory

Creating Timed Dialog Boxes

Popup

 

Capabilities Provided by the WshNetwork Object

 

Category

Method or Property

Working with network drives

MapNetworkDrive

EnumNetworkDrives

RemoveNetworkDrive

Working with network printers

AddPrinterConnection

AddWindowsPrinterConnection

EnumPrinterConnections

SetDefaultPrinter

RemovePrinterConnection

Obtaining information about the currently logged-on user

ComputerName

UserDomain

UserName

 

Valid XHTML 1.0 Transitional