0

I am trying to create a watch dog. in C# Which will keep looking for a exe if it is running or not if that exe is not running. Watch dog should automatically start the exe.

Example :

My exe is notepad.exe. I want to run a watch dog to see notepad.exe is running all the time. If some body closed it or some hoe some crash has happened watch dog should start the notepad.exe automatically.

Please help me with some snipet or some link for this approch.

Thanks

  • what have your tried? – phil soady May 24 '13 at 06:21
  • and a simple search would have found this http://stackoverflow.com/questions/11146381/whats-the-best-way-to-watchdog-a-desktop-application That took 20 secs.... – phil soady May 24 '13 at 06:48
  • Write a windows service which starts a timer and executes a Process.GetProcesses() regularly. Check if the list returned contains your process. If it doesn't, start it. – David Brabant May 24 '13 at 06:48

1 Answers1

0

start here

   Process.GetProcessesByName();

would be good to see evidence of thought, attempts research etc...

phil soady
  • 11,043
  • 5
  • 50
  • 95