[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
  1. @echo off
  2. %1 start "" mshta vbscript:createobject("shell.application").shellexecute("""%~0""","REM",,"runas",1)(window.close)&exit
  3. REM name
  4. set "process=powershell.exe"
  5. REM memory(KB)
  6. set "m=73800"
  7. :loop
  8. echo %process%
  9. echo %m%KB
  10. echo.
  11. tasklist /fi "IMAGENAME eq %process%" | findstr /i "pid = %process%"
  12. taskkill /f /fi "IMAGENAME eq %process%" /fi "MEMUSAGE gt %m%"
  13. timeout /t 2 /nobreak  >nul 2>nul & cls
  14. goto :loop
  15. pause&exit
复制代码
进程名和内存自行修改

TOP

回复 3# heike045

/t后面是秒数,当前是2秒检查一次
  1. timeout /t 2 /nobreak
复制代码

TOP

回复 6# heike045


        显示和结束进程命令之间有延迟吧,实际上已经达到了,不然不会关闭

TOP

  1. @echo off
  2. %1 start "" mshta vbscript:createobject("shell.application").shellexecute("""%~0""","REM",,"runas",1)(window.close)&exit
  3. :begin
  4. REM CODE 1
  5. timeout /t 60 /nobreak  >nul 2>nul
  6. REM CODE 2
  7. timeout /t 60 /nobreak  >nul 2>nul
  8. REM CODE 3
  9. timeout /t 60 /nobreak  >nul 2>nul
  10. goto :begin
  11. pause&exit
复制代码
回复 9# heike045
REM 所在行替换成你的代码,提权代码须放在开头

TOP

本帖最后由 went 于 2020-4-3 13:54 编辑
  1. @echo off&color 2f
  2. %1 start "" mshta vbscript:createobject("shell.application").shellexecute("""%~0""","REM",,"runas",1)(window.close)&exit
  3. set "s=60"
  4. :loop
  5. REM --------------------------------CODE1-----------------------------------
  6. taskkill /f /im "werfault.exe"
  7. timeout /t %s% /nobreak  >nul 2>nul
  8. REM --------------------------------CODE2-----------------------------------
  9. tasklist /FI "username eq dc2-user" | find /C "vds-qt.exe" > temp.txt
  10. set /p num= < temp.txt
  11. del /F temp.txt
  12. echo %num%
  13. if "%num%" == "0" del /F C:\Users\dc2-user\AppData\Roaming\VDS\mncache.dat C:\Users\dc2-user\AppData\Roaming\VDS\mnpayments.dat && start /D "C:\Program Files\vds" vds-qt.exe
  14. timeout /t %s% /nobreak  >nul 2>nul
  15. REM --------------------------------CODE3-----------------------------------
  16. REM name
  17. set "process=vds-qt.exe"
  18. REM memory(KB)
  19. set "m=6144000"
  20. echo %process%
  21. echo %m%KB
  22. echo.
  23. tasklist /fi "IMAGENAME eq %process%" | findstr /i "pid = %process%"
  24. taskkill /f /fi "IMAGENAME eq %process%" /fi "MEMUSAGE gt %m%"
  25. timeout /t %s% /nobreak  >nul 2>nul
  26. cls & goto :loop
  27. pause&exit
复制代码
回复 11# heike045

TOP

回复 15# heike045


   不好意思,我也不知道

TOP

返回列表