O'Reilly logo

Microsoft® Windows® Scripting Self-Paced Learning Guide by Ed Wilson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Connecting to the Registry

To work with the registry, you need to connect to it first. You can use the WMI StdRegProv class to make a connection and to read or write information into it. Although reading from the registry is a safe process, writing to the registry could have disastrous consequences if you don’t take normal safety precautions such as making a backup of the key you intend to change and testing the script in a lab on machines that would be easily recoverable.

At times, just being able to read a listing of keys is sufficient for your needs. For instance, when the hotfix installer is run, it creates an entry under HKLM\SOFTWARE \Microsoft\Windows NT\CurrentVersion\HotFix. Realizing this, if you read this key, you can see what hotfixes ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required