26 Oct Go beyond simple queries and get the inside track on how to write system administration scripts with Windows Management Instrumentation. Selection from Microsoft® Windows® Scripting Self-Paced Learning Guide [Book] Scripting Host (WSH), Windows Management Instrumentation (WMI), and. Microsoft Windows Scripting with WMI: Self-Paced Learning Guide [Ed Wilson] on *FREE* shipping on qualifying offers. Go beyond simple queries.

Author: Sajind Faurisar
Country: Andorra
Language: English (Spanish)
Genre: Relationship
Published (Last): 13 October 2010
Pages: 142
PDF File Size: 5.88 Mb
ePub File Size: 3.80 Mb
ISBN: 207-7-57246-226-8
Downloads: 27789
Price: Free* [*Free Regsitration Required]
Uploader: Kazrajas

From the Edit menu, select Replace to display the Replace dialog box. Reference Information In the Reference information section, shown next, you make your connection to WMI and then execute a query: It tells VBScript to go to the next line in the script when there is an error.

Save the file, and run it. Run the script—it should work fine to this point. What is the difference between Do Until and Do While? Bruce Stewart added it Jan 25, You do the same thing for the other two registry keys.

This means that you Chapter 2 Getting in the Loop 41 read a line of text, one line at a time, until you reach the end of the file. This makes more sense than filtering out number 3 drive types.

File It Under Files. Perhaps a better alternative is the CScript approach.


This script has only three variables: Refresh and try again. There are three important elements to selv-paced attention to in implementing the If…Then construct: By containing that information in an If…Then…ElseIf construct, you can translate the data into useful information.

StrComputerRole holds the friendly description of the actual computer role and is used by WScript. Since an array is zerobased that is, it begins counting at zeroyou set i to an initial value of zero.

Finally, you looked at modifying scripts and learned to determine which parts of the script can be re-used and which parts need to be re-created.

In the next line, you make colNamedArguments equal to the named arguments by using the Set command. Open a CMD prompt and switch to the directory where you saved the script.

Microsoft Windows Scripting with WMI

Modifying the Header Information The first three lines of your script can remain exactly the same. It can also be done for routine variables that are associated with one another, such as objWMIService and objProcessor from your earlier script. ObjScriptFile leatning assigned to the text that is contained in the variable named objScriptFile. On Error means that you want the computer to do something if it finds an error.

A quick search at http: Next, you populate the array with your computer names, making sure to enclose the names in quotation marks; and scriptnig use a comma to separate the values. Summary In this chapter, you looked at your first script. Have the intern copy the output from the command prompt and paste it into a Notepad file that has the same name as the server.


Microsoft Windows scripting self-paced learning guide

The first is to include On Error Resume Next in your script. David Bundus rated it it was amazing May 10, In the Find What box, type Dim. If you had five drives in your collection, guess what? To do so, open up a CMD prompt, and type cscript and the filename.

Microsoft Windows Scripting with WMI: Self-Paced Learning Guide

Using the techniques outlined in Microsoft Windows Scripting Self-Paced Learning Guide, anyone self-apced begin crafting custom scripts within minutes of opening these pages.

Echo to print out the results of your script. Instead of simply using a 0 or a 1, you tell VBScript the name to expect from the command line. Why do you do this?