Detecting a Non-Responding Application
Moderator: DosItHelp
Detecting a Non-Responding Application
Hi,
a) Can we identify Non Responsive/ crashed applications using Batch file? If yes then how?
I want to run a email alert command if my desired application crashes.
b) Is there any way to Ping applications like we can ping web sites?
Thanks
a) Can we identify Non Responsive/ crashed applications using Batch file? If yes then how?
I want to run a email alert command if my desired application crashes.
b) Is there any way to Ping applications like we can ping web sites?
Thanks
Re: Non Responce Applications
tasklist can provide details about a non-responsive task:
Code: Select all
Filter Name Valid Operators Valid Value(s)
----------- --------------- --------------------------
STATUS eq, ne RUNNING | SUSPENDED
NOT RESPONDING | UNKNOWN
Re: Non Responce Applications
foxidrive wrote:tasklist can provide details about a non-responsive task:Code: Select all
Filter Name Valid Operators Valid Value(s)
----------- --------------- --------------------------
STATUS eq, ne RUNNING | SUSPENDED
NOT RESPONDING | UNKNOWN
How did you generated that?
I tried this code
Code: Select all
Tasklist >c:\List.txt
Image Name PID Session Name Session# Mem Usage
========================= ====== ================ ======== ============
System Idle Process 0 Console 0 28 K
System 4 Console 0 240 K
smss.exe 828 Console 0 388 K
csrss.exe 876 Console 0 7,048 K
winlogon.exe 908 Console 0 1,716 K
services.exe 952 Console 0 4,664 K
Awaiting
Re: Non Responce Applications
Code: Select all
tasklist /?
Re: Non Responce Applications
foxidrive wrote:Code: Select all
tasklist /?
Yes, I noticed after replying to you. But can you make a code to check status for example note.exe and if not responding then run a command other wise go to Loop.
Thanks
Re: Non Responce Applications
foxidrive wrote:Code: Select all
tasklist /?
ok this code can check notepad.exe status running. But if its status become other than "running" i want to run another command and if status is "running" then go to loop. how i can do this?
Code: Select all
tasklist /fi "imagename eq notepad.exe" /fi "STATUS eq running" >c:\test.txt
Re: Non Responce Applications
This should launch run.exe when note.exe is not responding.
Code: Select all
tasklist /FI "IMAGENAME eq note.exe" /FI "status eq NOT RESPONDING" 2>&1 |find ":" >nul || run.exe
Re: Non Responce Applications
Great,,, Thank you,,,,,
I write this one,, I think this will work as well.
I write this one,, I think this will work as well.
Code: Select all
:Loop
tasklist /fi "imagename eq notepad.exe" /fi "STATUS eq running" goto SkipAlert
:: command to run here if program not equal to Status "Running"
msg * Program not responding
:SkipAlert
GoTo :Loop
Re: Non Responce Applications
Foxidrive, your codes is working. Mine is not. I will use yours.
Thanks
Code: Select all
:loop
tasklist /fi "imagename eq notepad.exe" /fi "STATUS ne RUNNING" |find "." >nul && goto 1Alert
goto loop
:1Alert
Msg * Start Alert Not Responding program
pause
Thanks
Re: Non Responce Applications
One problem Tasklist find if note.exe is in the list and if any other program having Not Responding status then it run.exe
Is there a way to tell Tasklist to check Not Responding Status for note.exe only and if its not responding then run.exe
Thanks
Is there a way to tell Tasklist to check Not Responding Status for note.exe only and if its not responding then run.exe
Thanks
Re: Detecting a Non-Responding Application
How did you test that?
I assumed the filters were ANDed.
I assumed the filters were ANDed.
Re: Detecting a Non-Responding Application
foxidrive wrote:How did you test that?
I assumed the filters were ANDed.
I run this code and it show me that there was some other Not Responding application running which triggering Alert and it is not monitoring my specific required application. Is there any way? Do not know what is ANDed means.
Code: Select all
:loop
Tasklist /FI "IMAGENAME eq MessageCenter.exe" /fi "STATUS eq NOT RESPONDING" |find "." >nul && goto StartAlert
goto loop
:StartAlert
Tasklist /fi "STATUS eq NOT RESPONDING" >>c:\NotResponding.txt
Re: Detecting a Non-Responding Application
mohdfraz wrote:Code: Select all
Tasklist /fi "STATUS eq NOT RESPONDING" >>c:\NotResponding.txt
This line is going to show you EVERY non responding program. That's what it is being told to do.
I don't understand what you are doing, or what you want to do, and how you are including it into your code.
Re: Detecting a Non-Responding Application
foxidrive wrote:mohdfraz wrote:Code: Select all
Tasklist /fi "STATUS eq NOT RESPONDING" >>c:\NotResponding.txt
This line is going to show you EVERY non responding program. That's what it is being told to do.
I don't understand what you are doing, or what you want to do, and how you are including it into your code.
Right, I am using the list to identify issue, But I really want that if MessageCenter.exe becomes Not Responding status then execute Run.exe ,,, Is there any way to do this using?
Re: Detecting a Non-Responding Application
You already have that code. How does it fail?