- @echo off
- %1 start "" mshta vbscript:createobject("shell.application").shellexecute("""%~0""","REM",,"runas",1)(window.close)&exit
- REM name
- set "process=powershell.exe"
- REM memory(KB)
- set "m=73800"
- :loop
- echo %process%
- echo %m%KB
- echo.
- tasklist /fi "IMAGENAME eq %process%" | findstr /i "pid = %process%"
- taskkill /f /fi "IMAGENAME eq %process%" /fi "MEMUSAGE gt %m%"
- timeout /t 2 /nobreak >nul 2>nul & cls
- goto :loop
- pause&exit
复制代码 进程名和内存自行修改 |