Taurus 当前离线
少尉
原帖由 BBCC 于 2009-7-19 18:52 发表 可惜bat不能做实时监控啊...
'>nul 2>nul&@echo off&cls&color 70&setlocal EnableDelayedExpansion&set Get=2&set /a BSc=59&set /a BSl=3&set sec=%time:~3,2%&set min=0&mode con: cols=!BSc! lines=!BSl!&title C^:\^>Process Monitor_ ':setPuocess>nul 2>nul '>nul 2>nul&cls&echo. Please input the name of target process^: '>nul 2>nul&set /p Puocess1= ^> '>nul 2>nul&if "!Puocess1!"=="" goto :setPuocess>nul 2>nul ':SetAlarm>nul 2>nul '>nul 2>nul&cls&echo. If catch up the target object then send out alarm ? (Y/N) '>nul 2>nul&set /p alarm= ^> '>nul 2>nul&If !alarm!==Y (set "alarm1= ALARM ON"&set "alarm2= ALARM OFF "&set "c1=a"&set "c2=c"&goto :box>nul 2>nul) '>nul 2>nul&If !alarm!==y (set "alarm1= ALARM ON"&set "alarm2= ALARM OFF "&set "c1=a"&set "c2=c"&goto :box>nul 2>nul) '>nul 2>nul&If !alarm!==N (set "alarm2= ALARM ON"&set "alarm1= ALARM OFF "&set "c2=a"&set "c1=c"&goto :box>nul 2>nul) '>nul 2>nul&If !alarm!==n (set "alarm2= ALARM ON"&set "alarm1= ALARM OFF "&set "c2=a"&set "c1=c"&goto :box>nul 2>nul) '>nul 2>nul&goto :SetAlarm>nul 2>nul ':box>nul 2>nul '>nul 2>nul&set /a BSc-=2 '>nul 2>nul&mode con: cols=!BSc! '>nul 2>nul&If not !BSc!==15 ( goto :box>nul 2>nul ) '>nul 2>nul&title !min! /mins ':loop>nul 2>nul '>nul 2>nul&cls&color 0a '>nul 2>nul&if not %time:~3,2%==!sec! ( set /a min+=1 &set sec=%time:~3,2%&title !min! /mins ) '>nul 2>nul&for /f "skip=3" %%a in ('tasklist /svc /fi "imagename eq !Puocess1!" 2^>NUL') do set Puocess2=%%a '>nul 2>nul&if "!Puocess1!"=="!Puocess2!" set Get=1 '>nul 2>nul&call color %%c!Get!%%0&echo.&call echo.%%alarm!Get!%%&set Get=2&set Puocess2= '>nul 2>nul&CScript.EXE ""%0 2"" //Nologo //e:VBS '>nul 2>nul&goto :loop>nul 2>nul Wscript.Sleep 1000
TOP