批处理文件中如何判断本地是否正在运行某个程序,并给出提示?

2025-02-27 03:46:34
推荐回答(1个)
回答1:

@echo off
tasklist|findstr "loli.exe lilo.exe"
if %errorlevel%==0 (msg /W /TIME:300 %username% 有一个程序正在运行) else (goto next)
:next
这里是你的批处理