Subscribe to Windows IT Pro
May 08, 2006 12:00 AM

Utility Monitors Crucial Processes

Windows IT Pro
InstantDoc ID #49908
Rating: (0)
Downloads
49908.zip

The checkres subroutine also uses a function named userinfo. This function uses Windows Script Host's (WSH's) WScript.Network object to retrieve the username and computer name. This object lets you easily access shared resources on Windows networks.

If you have Microsoft Word installed on your local computer, you can test the utility by following these steps:

  1. In the sample process.txt file, delete all the entries except WINWORD.EXE.
  2. Make sure Word isn't running on your computer.
  3. Run CheckProcess .hta. In the utility's UI, WINWORD.EXE's Status column should read DOWN.
  4. Start Word.
  5. Run CheckProcess.hta. WINWORD.EXE's Status column should now read UP.

You can customize this utility so that it performs a specific action when a process goes down. For example, when a process goes down, you can add code that displays an alert box, sends an email, or restarts the process. Listing 2 shows where you can add such code.

The CheckProcess utility works on Windows XP, Windows 2000, and Win2K Professional machines that have WSH 5.6 installed. To verify the WSH version on your machine, run the command

cscript //Logo 

from the command line. The first line in the output will show the WSH version.

Related Content:

ARTICLE TOOLS

Comments
    There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.