On Your Own: Lab 7 Working with Passing Arguments

In this lab, you’ll work with passing arguments by modifying a script that uses WMI to list all the services associated with a particular process on the machine. This is in fact a very useful script. While we are at it, we will simplify the script a little to make it easier to read.

Lab Instructions

  1. Open the servicesProcess.vbs script and save it as lab7.vbs.

  2. Add the Option Explicit command at the top of the script.

  3. Declare each variable used in the script. This would include the following:

    Dim objIdDictionary
    Dim strComputer
    Dim objWMIService
    Dim colServices
    Dim objService
    Dim colProcessIDs
    Dim i
  4. Save the script, and run it to ensure you have all the variables defined. If you missed a variable, Option ...

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.