Configuring the command shell to run scriptsMany scripts for computer management are more conveniently run from the command shell so that the user does not have to deal with the complications of windows and dialog boxes from the graphical user interface. It can be easier to handle output in a command window. One way to run a script in the command line is to preface the script with the executable Cscript.exe. For example, a statement of the form
cscript.exe somescript.vbscan be entered into the command line and somescript.vbs will then run in the command window. Note, however, that the fully qualified path must generally be used and pathnames with spaces must be enclosed in quotation marks. To make the script processor Cscript the default host for scripts, enter into the command line
wscript //H:cscriptScripts can be then be run by simply entering into the command line
somescript.vbsThe default can be returned to the graphical interface with the command
Some scripts that come with Windows XP
Tucked away in the folder \Windows\System32\ are some files in VBScript format that most PC users have never heard of. Also included with the two system tool packages discussed on other pages are some tools that are in the form of scripts. Some of these are really just for administrators but there are several that might be of use to the average PC owner. They are listed below. More detail about these scripts is in the Windows XP Help and Support Center. Running these scripts is easier if Cscript is made the default interface.
- Lists the events and event properties from one or more event logs.Can be used with a filter to specify the types of events to include in or exclude from the query.
- Enables an administrator to display and configure a system's paging file Virtual Memory settings
- Configures or displays configuration information about a printer. Used without parameters, prncnfg.vbs displays command-line help.
- Adds, deletes, and lists printer drivers. Used without parameters, prndrvr.vbs displays command-line help.
- Pauses, resumes, cancels, and lists print jobs. Used without parameters, prnjobs.vbs displays command-line help.
- Adds, deletes, and lists printers or printer connections, in addition to setting and displaying the default printer. Used without parameters, prnmngr.vbs displays command-line help.
- Creates, deletes, and lists standard TCP/IP printer ports, in addition to displaying and changing port configuration. Used without parameters, prnport.vbs displays command-line help.
- Prints a test page, pauses or resumes a printer, and clears a printer queue. Used without parameters, prnqctl.vbs displays command-line help.
Windows Management Instrumentation Command-line (WMIC) toolWMIC is a command-line and scripting interface that simplifies the use of Windows Management Instrumentation (WMI). WMIC is based on aliases. Aliases make the primary data provided by WMI available without having to understand WMI-specific concepts.More details are at this Microsoft reference. Information is also available on a local computer by entering into a command prompt
WMIC /?One use of WMIC is to write simple scripts to automate the management of a computer.