求大神指教→_→这段哪里错了
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
2015年05月07日 13点05分
level 11
1L /n后面少打了一个1手贱→_→ 不管有没有 都是错误 一闪而过[泪]
2015年05月07日 13点05分 4
level 8
等号前后引号应该一致。
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
直接用逻辑连接符号&&和||吧
tasklist|findstr "dnf.exe"||goto word
2015年05月07日 14点05分 6
谢谢[花心]
2015年05月09日 00点05分
1