![]() |
中国DOS联盟-- 联合DOS 推动DOS 发展DOS --联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum |
| 游客 | 登录 | 注册 | 会员 | 搜索 | 中国DOS联盟 |
|
中国DOS联盟论坛 现在时间是 2026-09-09 18:18 |
共 47,812 主题排行 / 349,914 发帖 / 今日 0 篇 / 48,268 会员排行 |
| DOS批处理 & 脚本技术(批处理室) » 自动arp清除.bat |
| 可打印版本 740 / 1 |
| 第1楼 xiaoyong12 | 发表于 2009-05-13 15:01 |
| 初级用户 发帖 22 积分 38 | |
|
自动arp清除.bat @echo off&&setlocal enabledelayedexpansion
set name=%~n0 title %name% is made by xiaoyong if exist %tmp%\ipconfig.txt del %tmp%\ipconfig.txt ipconfig /all >%tmp%\ipconfig.txt if exist %tmp%\GateIP.txt del %tmp%\GateIP.txt find "Default Gateway" %tmp%\ipconfig.txt >%tmp%\GateIP.txt for /f "skip=2 tokens=13" %%G in (%tmp%\GateIP.txt) do set GateIP=%%G if exist %tmp%\IPAddr.txt del %tmp%\IPaddr.txt find "IP Address" %tmp%\ipconfig.txt >%tmp%\IPAddr.txt for /f "skip=2 tokens=15" %%I in (%tmp%\IPAddr.txt) do set IP=%%I del %tmp%\ipconfig.txt del %tmp%\GateIP.txt del %tmp%\IPAddr.txt echo ***************************** echo * * echo * 1.ping GateIP * echo * * echo * 2.ping 本机IP * echo ***************************** set /p choice=请选择(1——2): if !choice! equ 1 set pin=%GateIP% if !choice! equ 2 set pin=%IP% cls mode con cols=55 lines=4 set count=0 :return if exist %tmp%\ping.txt del %tmp%\ping.txt ping -n 2 %pin%>%tmp%\ping.txt&&goto display :display for /f "delims= tokens=1-6 skip=3" %%I in (%tmp%\ping.txt) do ( cls set var=%%I set/p=!var!<nul set m=!var:~0,5! ping -n 1 127.0.0.1>nul&&goto out ) utif not "!m!" == "Reply" goto hello goto return :hello for /l %%a in (1,1,10) do ( arp -d ) set /a count=count+1 if !count! equ 8 goto IPrestore goto return :IPrestore nbtstat -R ipconfig /flushdns nbtstat -RR ipconfig /registerdns set /a count=0 goto return 很久以前写的。 附件 自动arp清除.rar (768 bytes) |
|
| 第2楼 yixiang | 发表于 2009-05-15 02:50 |
| 新手上路 发帖 6 积分 13 | |
|
貌似很强大哦
|
|
|
[ 联系联盟系统管理团队 -
中国DOS联盟 -
标准版 ] Sponsored by ifanr Inc | © 2001–2023 |