We have about ten client computers ranging from Windows XP to Windows 7 that have a little program that runs in the tray. This program needs to be running at all times and sometimes it either crashes or a user exits the program. We would like to be able to check every hour or so to see if this program is running. If it is not running, it should be started.

I have tried using powershell on one of our servers to get the process from a remote computer and if it doesn't find it, to start it. But, that fails because it cannot start the process as an interactive user.

I tried setting up a task in task scheduler, but Windows XP task scheduler is not very good or configurable.

We would like this to be as easy to administer as possible. What would be the best way to do this?

  • is the program a service or a user startup application? – tony roth Jul 13 '10 at 16:52
  • It is a user startup application. – awilinsk Jul 13 '10 at 17:39

Could you use sc.exe to run the executable as a Service?

  • I followed the instructions in the article, but cannot get it to install as a service. When I run the command, it just returns the usage of the command and doesn't install the service. – awilinsk Jul 13 '10 at 18:44
  • Sorry to hear that; some apps may not play well as a service. Perhaps look at firedaemon.com. Long ago that worked for me where sc.exe did not. – AndyN Jul 14 '10 at 22:28
  • Excellent. That's exactly what I'm looking for. – awilinsk Jul 15 '10 at 12:02

Task scheduler can do this, the problem with it is it won't notify you if it fails. But you could put together a batch file and tlist (a free tool from Microsoft) to see what processes are running. If the batch file doesn't see it running according to tlist, you simply start it. If it's found, you use a goto to skip over everything and exit the batch file.

  • I have that already. The problem with Task Scheduler for XP is that you cannot run the program as the logged in user. The machines are logged in under an extremely locked down account and you cannot access task scheduler from that account. – awilinsk Jul 13 '10 at 20:22

Do you have nagios or any monitoring system in your infrastructure ? ? If yes, it's quite simple to monitor it.

Otherwise, you could use snmp to do this job.

  • I have no problem telling if the process is running or not. The problem comes when I try to create the process. It needs to be created as the logged in user on the remote machine so it appears in their system tray. – awilinsk Jul 13 '10 at 20:36
  • IF you used linux you could use the "su" in order to that.But I don't know how you could do it on Windows :< – Nikolaidis Fotis Jul 13 '10 at 22:25

If you don't already run Nagios I'd be inclined to create a batch file on a monitoring machine which would run pslist piped through find on each of the client machines. If you don't see the name of the executable it's not running. You could use Blat to send you alerts.

If you do run Nagios you could run the same thing on each client as an NSClient++ check and gather the results with Nagios.

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.