Monitoring Mem Usage of specific process on XP
Posted: 18 Jul 2012 08:11
Trying to keep something running in the background to monitor the memory usage (as seen in Process in Task Manager) of a specific process and when a specific size is met to create a dialog box with a message. So it would simply loop until it's found. I've tried several variations to no avail. Anyone mind taking a look? This is what I got:
The way I test is simply modifying the size (i.e. 30000) which is denoted in KB's. I modify the size either intentionally larger or smaller (since the operation "ge" is greater than or equal) which does not effect whether the message occurs or not.
Thanks everyone!
:loop
Sleep 1
TASKLIST /FI "IMAGENAME eq explorer.exe" /FI "MEMUSAGE ge 30000"
if ERRORLEVEL 1 (goto :loop) else (goto :announce)
:announce
echo MSGBOX "Internet Explorer is not responding. Reference code: 1x000133t" > %temp%\TEMPmessage.vbs
call %temp%\TEMPmessage.vbs
del %temp%\TEMPmessage.vbs /f /q
exit
The way I test is simply modifying the size (i.e. 30000) which is denoted in KB's. I modify the size either intentionally larger or smaller (since the operation "ge" is greater than or equal) which does not effect whether the message occurs or not.
Thanks everyone!