Windows中有时需要进程名检查进程是否存在。
 
根据检查频率不同,批处理程序可以写成以下两种:

单次检查

@echo off 
@for /f %%i in ('tasklist /nh') do if "%%i"=="WinKawaks.exe" echo "exist" & goto end
@echo "not exist" 
:end

实时检查

@echo off 
:loop
tasklist /nh | find /i "WinKawaks.exe" > null
if ERRORLEVEL 1 (echo "not exist") else (echo "exist")
goto loop




相关文章:

  • 2021-08-25
  • 2021-08-28
  • 2022-12-23
  • 2021-09-26
  • 2021-06-26
  • 2022-03-13
  • 2022-12-23
  • 2021-08-12
猜你喜欢
  • 2021-09-21
  • 2021-05-30
  • 2022-12-23
  • 2021-12-23
  • 2021-06-20
  • 2022-12-23
  • 2021-11-20
相关资源
相似解决方案