2011-02-06 49 views

回答

3
@echo off 
for /L %%i in (1,1,10) do (
@echo testing 192.168.0.%%i 
ping 192.168.1.%%i > nul 
if ERRORLEVEL 1 @echo error ping %%i) 
0

嗯,for循環應該是這樣的:

for /l %i in (1,1,10) do ping 192.168.0.%i 

所以腳本會是這樣的:

for /l %i in (1,1,10) do (
    ping 192.168.0.%i 
    if %errorlevel% neq 0 echo error 
) 
+0

不工作..我保存在批處理文件中的代碼。 – 2011-02-06 08:50:56