Microsoft® Windows® 2000 Scripting Guide
« Previous | Next »
In Windows 2000, WMI is primarily a read-only technology; you use it mainly to retrieve information about managed resources. However, some WMI properties are read/write. This means you can use a script not only to retrieve the values of these properties but also to configure those values.
For example, the script in Listing 6.25 retrieves all instances of the Win32_OSRecoveryConfiguration class. (In this case, the class contains only a single instance.) The script provides new values for properties such as DebugInfoType and DebugFilePath and then applies the changes (and thus configures operating system recovery options) by using the Put_ method. If you do not call the Put_ method, the changes will not be applied.
Note
Listing 6.25 Template for Writing Resource Properties
|
|
To use this template with other WMI classes and to configure other WMI properties:
objInstance.DebugInfoType = 1 objInstance.DebugFilePath =
"c:\scripts\memory.dmp
"objInstance.OverWriteExistingDebugFile = False
Send us your feedback | « Previous | Next » |