电竞比分网-中国电竞赛事及体育赛事平台

分享

如何ping指定的一段范圍的ip地址

 _CZY_ 2017-02-25

使用記事本編輯測(cè)試腳本,命名為testping.cmd.txt,內(nèi)容為:

@echo offecho 執(zhí)行中,請(qǐng)稍后...echo ping日期:%date%>>pingresult.txtecho ping時(shí)間:%time%>>pingresult.txtecho.>>pingresult.txtecho 具體數(shù)據(jù):>>pingresult.txtfor /l %%i in (100,1,200) do ping -n 1 -w 60 192.168.115.%%i | find '回復(fù)' >> pingresult.txtecho ----------------------------------------------------------->> pingresult.txt

其中,for /l %%i in (100,1,200)中的100代表ping的起始ip,1代表步長(zhǎng),200代表結(jié)束ip。后面的192.168.115是ping的網(wǎng)段。這個(gè)腳本的含義相當(dāng)于ping 192.168.115.100-192.168.115.200,ip地址的步長(zhǎng)增加為1。腳本執(zhí)行結(jié)束后會(huì)將結(jié)果輸出到pingresult.txt中。

編輯好腳本之后,將文本pingtest.cmd.txt重命名為pingtest.cmd,雙擊。

pingtest.cmd腳本執(zhí)行結(jié)束之后產(chǎn)生pingresult.txt文件,打開(kāi)后可以看到結(jié)果:




    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多