Arrays

Microsoft® Windows® 2000 Scripting Guide

microsoft windows 2000 scripting guide

« Previous | Next »   

Scripts are probably most useful when you need to carry out the same task multiple times. For example, if you own one computer, it is just as quick and just as easy to open the Services snap-in to see which services are installed as it would be to write a script to retrieve the same information. If you have 100 computers, however, you will likely prefer using a script to retrieve service information as opposed to manually retrieving this information.

Of course, if a script is to run against 100 different computers, it needs a way to store those computer names and a way to keep track of which computers it has retrieved service information from and which computers it has not. One common way to store related bits of information (such as a list of computer names) is in an array, a special type of variable that can be used to store (and later retrieve) multiple values.

Note

  • A full discussion of arrays, including the use of multidimensional arrays, is beyond the scope of this chapter. This chapter focuses on those aspects of arrays most commonly used in system administration scripts.

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