Microsoft® Windows® 2000 Scripting Guide
« Previous | Next »
You rarely need to create a registry subkey. However, in some circumstances the solution to a problem as described in a Knowledge Base article or a security bulletin requires the addition of a subkey. If you need to create a subkey on a large number of computers, the best solution might very well be a script. After all, a single script can be used to create the subkey on every computer affected by the problem.
The Registry Provider s CreateKey method enables you to add a new subkey. It takes two parameters: a constant indicating the subtree to which the new subkey will be added and the path of the new subkey.
Listing 16.8 contains a script that creates a subkey in the SOFTWARE key under the subtree HKEY_LOCAL_MACHINE in the registry. To carry out this task, the script must perform the following steps:
Listing 16.8 Creating a Subkey
|
|
Figure 16.4 shows the newly created subkey in a registry editor.
Figure 16.4 Viewing a Newly Created Subkey Using a Registry Editor
Viewing a Newly Created Subkey Using a Registry Editor
Send us your feedback | « Previous | Next » |