Board logo

标题: 自动网络切换器 [打印本页]

作者: daitao1986     时间: 2007-10-17 19:21    标题: 自动网络切换器

@echo off
color 0a
title ~自动网络切换器~ by ╰☆孤影☆╮
route change 0.0.0.0 mask 0.0.0.0 192.168.0.231 metric 1
ping 192.168.0.231>a.txt & type a.txt | find "Request timed out." && echo 网络1不可用 && goto 1
del a.txt
echo.
echo 网络1可用
echo.
SET daitao=ping 127.0.0.1 -n
%daitao% 5 > nul
goto del
:1
route change 0.0.0.0 mask 0.0.0.0 192.168.0.232 metric 1
ping 192.168.0.232>b.txt & type b.txt | find "Request timed out." && echo 网络2不可用 && goto 2
del b.txt
echo.
echo 网络2可用
echo.
SET daitao=ping 127.0.0.1 -n
%daitao% 5 > nul
goto del
:2
route change 0.0.0.0 mask 0.0.0.0 192.168.0.233 metric 1
ping 192.168.0.233>c.txt & type c.txt | find "Request timed out." && echo 网络3不可用 && goto 3
del c.txt
echo.
echo 网络3可用
echo.
SET daitao=ping 127.0.0.1 -n
%daitao% 5 > nul
goto del
:3
route change 0.0.0.0 mask 0.0.0.0 192.168.0.234 metric 1
ping 192.168.0.234>d.txt & type d.txt | find "Request timed out." && echo 网络4不可用 && goto del
del d.txt
echo.
echo 网络4可用
echo.
SET daitao=ping 127.0.0.1 -n
%daitao% 5 > nul
:del
del a.txt;b.txt;c.txt;d.txt
exit

[ Last edited by daitao1986 on 2008-12-31 at 09:06 ]