On Your Own: Lab 20 Writing an Informative WMI Script

In this lab, you are going to write a WMI script that returns a lot of information about processes. This will be used as the starter script in Lab 21.

Lab Instructions

  1. Open Notepad.exe.

  2. On the first line, type Option Explicit to ensure you declare all variables used in the script.

  3. Declare the following variables: objWMIService, colItems, objItem, and wmiQuery. Add comments following each declaration specifying what each variable is used for.

  4. Assign wmiQuery to be equal to a WQL Select statement that returns everything from the win32_Process. Your code will look like the following:

    wmiQuery = "Select * from Win32_Process"
  5. Set objWMIService equal to what comes back from the GetObject method when used ...

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.