How to monitor a Windows process and send an alert when it crashes or closes?

4

1

I'm looking for a program/utility to monitor a process running in Windows 7 (actually it's a Java process ran from .jnlp). and that can send an e-mail alert or trigger any kind of script so I can be aware that it has crashed ?

From what i've seen there's nothing like that.

Any ideas ?

Disco

Posted 2012-07-05T16:12:52.353

Reputation: 243

Answers

4

:begin
tasklist | find "java.exe"
IF %ERRORLEVEL% EQU 1  blat.exe ---
sleep 10
goto :begin

you'll need blat.exe which is the most used tool for sending mails via batch scripts sleep should be built-in windows 7. But this will work only if you have only one java.exe running... You can use some external tools to start a process and its PID for maximum usability

npocmaka

Posted 2012-07-05T16:12:52.353

Reputation: 887

I like bmail too: http://retired.beyondlogic.org/solutions/cmdlinemail/cmdlinemail.htm like blat but much leaner and smaller. free too.

– Sun – 2016-05-19T22:14:29.987

Excellent ! Right what i was looking for; is it possible to get a .bat to run as a service ? I saw some applications around for .exe2service did you try .bat ? – Disco – 2012-07-06T08:45:15.863

2

may be this could help: http://runasservice.sourceforge.net

– npocmaka – 2012-07-06T09:05:50.140

1!!! I LOVE YOU :) – Disco – 2012-07-06T12:54:54.393