• Welcome to Theos PowerBasic Museum 2017.

News:

Attachments are only available to registered users.
Please register using your full, real name.

Main Menu

Windows Script Host Objects

Started by José Roca, July 14, 2008, 06:29:21 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

José Roca

Windows Script Host Objects

Windows Script Host Objects

 

The following Windows Script Host objects can be used with the PowerBASIC compilers:

 

Objects

Interfaces

WshEnvironment

IWshEnvironment

WshNetwork

IWshNetwork, IWshNetwork2

WshScriptExec

IWshExec

WshShell

IWshShell, IWshShell2, IWshShell3

WshShortcut

IWshShortcut

WshSpecialFolders

IWshCollection

WshUrlShortcut

IWshURLShortcut

 

WshEnvironment Object

 

The WshEnvironment object is a collection of environment variables that is returned by the WshShell object's Environment property. This collection contains the entire set of environment variables (those with names and those without). To retrieve individual environment variables (and their values) from this collection, use the environment variable name as the index.

 

WshNetwork Object

 

Provides access to the shared resources on the network to which your computer is connected.

 

You create a WshNetwork object when you want to connect to network shares and network printers, disconnect from network shares and network printers, map or remove network shares, or access information about a user on the network.

 

WshScriptExec Object

 

Provides status information about a script run with Exec along with access to the StdIn, StdOut, and StdErr streams.

 

The WshScriptExec object is returned by the Exec method of the WshShell object. The Exec method returns the WshScriptExec object either once the script or program has finished executing, or before the script or program begins executing.

 

WshShell Object

 

Provides access to the native Windows shell.

 

You create a WshShell object whenever you want to run a program locally, manipulate the contents of the registry, create a shortcut, or access a system folder. The WshShell object provides the Environment collection. This collection allows you to handle environmental variables (such as WINDIR, PATH, or PROMPT).

 

WshShortcut Object

 

Allows you to create a shortcut programmatically.

 

WshSpecialFolders Object

 

Provides access to the collection of Windows special folders

 

The WshShell object's SpecialFolders property returns the WshSpecialFolders object, which is a collection of special folders. This collection contains references to Windows special folders (for example, the Desktop folder, Start Menu folder, and Personal Documents folder). This collection retrieves paths to special folders using the special folder name as the index. A special folder's path depends on the user environment. The information stored in a special folder is unique to the user logged onto the computer system. If several different users have accounts on the same computer system, several different sets of special folders are stored on the hard disk.

 

WshUrlShortcut Object

 

Allows you to create a shortcut to an Internet resource programmatically.

 

The WshUrlShortcut object is a child object of the WshShell object; you must use the WshShell method CreateShortcut to create a WshUrlShortcut object (e.g., WshShell.CreateShortcut(strDesktop & "Shortcut Script.lnk")).