Chapter 11: Using Operating System Classes 251
On Your Own
Lab 22 Monitoring the Shutdown of Applications
In this lab, you will use the Win32_ProcessStopTrace operating system event class to monitor
the shutdown of applications. You will have two processes running on your computer, and
when one of the processes stops, you want to capture the name and process ID of the process.
When the second process stops, you will once again capture this information.
1. Open the WmiTemplate.vbs script and sa
ve it as StudentLab22.vbs.
2. Modify the
wmiQuery to select everything from the Win32_ProcessStopTrace class. The
line looks like the following:
wmiQuery = "SELECT * FROM Win32_ProcessStopTrace"
3. Modify the Set colItems line to perform an Exe ...