@echo off
echo -----------------------------
echo 請選擇你所掃描的類型
echo -----------------------------
echo .
echo [A] :IP段掃描 [B] :精確IP及端口掃描
:x
set /p choice="請輸入掃描類型:A or B :"
if /i %choice%==a goto ipduan else goto y
:y
if /i %choice%==b goto ip else goto x
:ipduan
echo 進入IP段掃描模式:
set /p ipa="輸入掃描的ip段前三段(例如:192.168.1):"
set /p port="輸入要掃描的端口:"
for /l %%i in (1,1,255) do (telnet %ipa%.%%i %port%)
:ip
echo 進入精確掃描模式:
set /p ipa="輸入掃描的ip:(例如:192.168.0.1)"
set /p port1="輸入要掃描的開始端口:"
set /p port2="輸入要掃描的結束端口:"
for /l %%i in (%port1%,1,%port2%) do (telnet %ipa% %%i)
pause>nul
同問 誰能幫我找個工具或者做個 .bat代碼實現以下需求 我要批量PING 服務器
2011-01-17 19:05 提問者: sean027 |瀏覽次數:419次 誰能幫我找個工具或者做個 .bat代碼實現以下需求 我要批量PING 服務器,查看PING直。【最好是ping 10 次的平均值,和掉包率,不通最好也顯示】 最好是那種我導入TXT文件后出來一個TXT文件結果的。。大俠們 幫幫忙哦~!!!!
我并非問的是同一網段的IP哦,不是掃描軟件那種 192.168.0.1 - 192.168.0.255 這樣的,而是我有很多根本就完全不同的IP地址批量PING 沒規則 只能導入文件給IP表
滿意回答
2011-01-19 15:21
新建兩個文本文件,一個保存為test.bat,一個保存為test.txt,兩文件保存在一個文件夾下
test.txt的內容
192.168.0.29
127.1
test.bat的內容
@echo off
echo 正在ping網址,請稍候……
for /f %%i in (test.txt) do ping %%i /n 10 >>hello.txt
start "" "hello.txt"
ping 127.1 /n 3 >nul
del /f /q hello.txt
pause