Lab 19 Using Win32_Environment and VBScript to Learn About WMI

In this lab, you use Win32_Environment and VBScript to learn about both WMI and the environment settings on your server.

Lab Instructions

  1. Open Notepad.exe.

  2. On the first line, type Option Explicit.

  3. Use the Dim command to declare the following variables: objWMIService, colItems, objItem, wmiQuery, and strComputer.

  4. Use WScript.Echo and the Now function to indicate the script is beginning its run.

  5. Assign the value of "." to the variable strComputer.

  6. Assign the query "Select * from Win32_Environment" to the variable wmiQuery.

  7. Set objWMIService = to the handle that comes back from the GetObject function with the winmgmts: moniker. Incorporate the variable strComputer to tell WMI which computer to ...

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.