On Your Own: Lab 36 Monitoring Print Jobs

In this lab, you will practice monitoring print jobs by using the Win32_PrintJob WMI class.

Lab Instructions

  1. Open Notepad.exe.

  2. Set Option Explicit.

  3. Save your script as Lab36Solution.vbs.

  4. Declare the following variables: strComputer, wmiNS, wmiQuery, objWMIService, colItems, and objItem. Your Header information section will look like the following:

    Option Explicit
    'On Error Resume Next
    Dim strComputer
    Dim wmiNS
    Dim wmiQuery
    Dim objWMIService
    Dim colItems
    Dim objItem
  5. Assign the value "." to the variable strComputer.

  6. Assign the value "\root\cimv2" to the variable wmiNS.

  7. Assign the value "Select * from Win32_PrintJob" to the wmiQuery variable. The code for steps 5, 6, and 7 is shown here:

    strComputer = "." wmiNS = "\root\cimv2" ...

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.