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

  1. Open Notepad.exe.

  2. On the first line, type Option Explicit. Save your script as Lab35Solution.vbs.

  3. 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
  4. Define the constant for HKLM and set it equal to &H80000002. It will look like the following:

    Const HKLM = &H80000002 'HKEY_LOCAL_MACHINE
  5. 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.