更新时间:2023-12-05 11:45:22
我想到的另一种可能性是,使用 grep ,is:
Another possibility I came up with, inspired by using grep, is:
tasklist /FI "IMAGENAME eq myapp.exe" 2>NUL | find /I /N "myapp.exe">NUL
if "%ERRORLEVEL%"=="0" echo Programm is running
它不需要保存一个额外的文件,所以我喜欢这种方法。
It doesn't need to save an extra file, so I prefer this method.