Lab 35 Creating Registry Keys
In this lab, you create a couple of registry keys that can be used to keep track of a software inventory of the workstation.
Lab Instructions
Open Notepad.exe.
On the first line, type Option Explicit. Save your script as Lab35Solution.vbs.
Declare the following variables: strKeyPath, strComputer, objReg, subKey, arrSubKeys, and ParentKey. You code will look like the following:
Option Explicit Dim strKeyPath Dim strComputer Dim objReg Dim subKey Dim arrSubKeys Dim ParentKey
Define the constant for HKLM and set it equal to &H80000002. It will look like the following:
Const HKLM = &H80000002 'HKEY_LOCAL_MACHINE
Assign the value of " SOFTWARE\INVENTORY" to the ParentKey variable. It will look like the following:
ParentKey = "SOFTWARE\INVENTORY" ...
Get Microsoft® Windows® Scripting Self-Paced Learning Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.