本帖最后由 CrLf 于 2013-7-26 03:01 编辑
回复 2# batman
可以用 find /c 简化成:- @echo off
- for /f "delims=" %%a in ('tasklist /fo csv^|find /i /c ""qq.exe""') do if %%a gtr 2 calc.exe
复制代码 或者这样:- @echo off
- for /f "skip=2" %%a in ('tasklist /nh /fi "imagename eq qq.exe"') do calc.exe&goto next
- :next
复制代码 要极简就类似这样:- @echo off
- tasklist /fi "imagename eq qq.exe"|more +3|findstr .&&calc.exe
复制代码
|