求大神指教→_→这段哪里错了
bat吧
全部回复
仅看楼主
level 11
丿杜应师丶罒
楼主
@echo
off
:word
ping /n 127.0.0.1>nul
tasklist|findstr "dnf.exe"
if not %errorlevel%=="0" goto word
taskkill /f /im "dnf.exe"
2015年05月07日 13点05分
1
level 11
丿杜应师丶罒
楼主
这段哪里有错了→_→
@echo
off
:word
ping /n 127.0.0.1>nul
for %%i in (dnf.exe) do (tasklist|findstr "%%i"&if %errorlevel%=="128" goto word)
taskkill /f /im "dnf.exe"
2015年05月07日 13点05分
2
丿杜应师丶罒
不存在的时候返还值是128
2015年05月07日 13点05分
level 11
丿杜应师丶罒
楼主
@黄田杰
@aiwozhonghuaba
2015年05月07日 13点05分
3
丿杜应师丶罒
@aiwozhonghuaba
2015年05月07日 13点05分
level 11
丿杜应师丶罒
楼主
1L /n后面少打了一个1手贱→_→ 不管有没有 都是错误 一闪而过
2015年05月07日 13点05分
4
level 8
nefu_20061617
等号前后引号应该一致。
if not %errorlevel%==0 goto word
或者
if not "%errorlevel%"=="0" goto word
2楼应该用 if errorlevel 1 这种格式,或者启用延迟变量。
2015年05月07日 13点05分
5
丿杜应师丶罒
对了 非常感谢
2015年05月07日 13点05分
丿杜应师丶罒
回复
د��Ӧʦؼ��
:延迟变量能用叹号吗
2015年05月07日 13点05分
level 14
aiwozhonghuaba
直接用逻辑连接符号&&和||吧
tasklist|findstr "dnf.exe"||goto word
2015年05月07日 14点05分
6
丿杜应师丶罒
谢谢
2015年05月09日 00点05分
1