O'Reilly logo

Microsoft® Windows® Scripting Self-Paced Learning Guide by Ed Wilson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required