Displaying Output

Microsoft® Windows® 2000 Scripting Guide

microsoft windows 2000 scripting guide

« Previous | Next »   

One limitation of both Microsoft® Visual Basic® Scripting Edition (VBScript) and Windows Script Host (WSH) is the fact that neither language has any built-in functions for displaying output in anything but the most basic of formats. Because of this, script output is typically displayed in a command window by using a series of Wscript.Echo commands. This is acceptable for scripts that display a single item of information per line; for example, you might have a script that reports the name of each service installed on a computer:

Alerter Application Management Ati HotKey Poller Computer Browser Indexing Service 

However, Wscript.Echo is far less than useful for scripts that display multiple items on a single line. For example, the following output displays three separate service-related properties: service display name, service start mode, and service state. Unfortunately, these properties and their values are difficult to distinguish from one another because of the way they are displayed:

Alerter Auto Running Application Management Manual Running Ati HotKey Poller Auto Stopped Computer Browser Auto Running Indexing Service Manual Stopped 

If you have scripts that display a large amount of data, you might not want to simply echo values to the command window; instead, you might prefer to use one of the following techniques to help make your script output easier to read and understand:

  • Display script output in table form in a command window.
  • Display script output in a browser window, taking advantage of the formatting capabilities available using HTML.
  • Use the tabular data control to display script output in a table within a browser window.

send us your feedback Send us your feedback « Previous | Next »   


Microsoft Windows 2000 Scripting Guide(c) Automating System Administration 2003
Microsoft Windows 2000 Scripting Guide(c) Automating System Administration 2003
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 635

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net