靜態(tài)路由快速配置工具,這款網(wǎng)絡(luò)工具能幫您快速配置路由器線路,實(shí)現(xiàn)全靜態(tài)路由管理效果,軟件支持批處理和自動(dòng)輸入功能,鍵入目標(biāo)按鍵即可完成相關(guān)的配置操作。本靜態(tài)路由配置軟件由論壇用戶原創(chuàng)制作分享,需要的朋友們快來試試吧!
軟件功能
1、添加路由
2、刪除路由
3、查看路由
4、手動(dòng)添加路由
5、手動(dòng)刪除路由
6、恢復(fù)默認(rèn)設(shè)置
代碼一覽
@echo off
rem //設(shè)置變量
rem //以下屬性值可以根據(jù)需要更改
rem //掩碼
set MASK=255.255.255.0
rem //網(wǎng)關(guān)
set GATEWAY=192.168.1.1
color 2f
mode con cols=80
title 靜態(tài)路由快速配置工具 Ver:1.0 %date% by:52pojie.cn@ggm
net.exe session 1>NUL 2>NUL && (
goto as_admin
) || (
goto not_admin
)
:not_admin
echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.
echo 本程序需要需要管理員權(quán)限!
echo.
echo 即將獲取管理員權(quán)限!請(qǐng)?jiān)趶棾龅拇翱邳c(diǎn)擊“是”!
echo.
echo 獲取成功后將自動(dòng)重啟程序,左上角會(huì)顯示管理員!
echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.
pause
%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit
goto sc_top
:as_admin
:sc_top
cls
echo.&echo.
echo 靜態(tài)路由配置
echo.
echo --------------------------------------------
echo.&echo.&echo.
echo 1、添加路由
echo.
echo 2、刪除路由
echo.
echo 3、查看路由
echo.
echo 4、手動(dòng)添加路由
echo.
echo 5、手動(dòng)刪除路由
echo.
echo 6、恢復(fù)默認(rèn)設(shè)置
echo.&echo.&echo.&echo.&echo.
set select=
set str1=123456
set /p select= 輸入數(shù)字,按回車:
if not defined select goto sc_wrong
echo %select%|findstr "[%str1%]">nul||goto sc_wrong
if %select%==1 (goto sc_add)
if %select%==2 (goto sc_del)
if %select%==3 (goto sc_print)
if %select%==4 (goto sc_madd)
if %select%==5 (goto sc_mdel)
if %select%==6 (goto sc_reset)
:sc_wrong
mshta vbscript:msgbox("只能輸入0-6的數(shù)字",64,"提示")(window.close)
goto sc_top
:sc_add
cls
echo 正在添加
route add -p 192.168.10.0 mask %MASK% %GATEWAY%
route add -p 192.168.11.0 mask %MASK% %GATEWAY%
route add -p 192.168.12.0 mask %MASK% %GATEWAY%
route add -p 192.168.13.0 mask %MASK% %GATEWAY%
route add -p 192.168.14.0 mask %MASK% %GATEWAY%
route add -p 192.168.15.0 mask %MASK% %GATEWAY%
route add -p 192.168.16.0 mask %MASK% %GATEWAY%
route add -p 192.168.17.0 mask %MASK% %GATEWAY%
route add -p 192.168.18.0 mask %MASK% %GATEWAY%
route add -p 192.168.19.0 mask %MASK% %GATEWAY%
route add -p 192.168.20.0 mask %MASK% %GATEWAY%
route add -p 192.168.21.0 mask %MASK% %GATEWAY%
route add -p 192.168.22.0 mask %MASK% %GATEWAY%
route add -p 192.168.23.0 mask %MASK% %GATEWAY%
route add -p 192.168.24.0 mask %MASK% %GATEWAY%
route add -p 192.168.25.0 mask %MASK% %GATEWAY%
route add -p 192.168.26.0 mask %MASK% %GATEWAY%
route add -p 192.168.27.0 mask %MASK% %GATEWAY%
route add -p 192.168.28.0 mask %MASK% %GATEWAY%
route add -p 192.168.29.0 mask %MASK% %GATEWAY%
echo 添加完成,按任意鍵查看路由表
pause>nul
cls
route print
echo 按任意鍵返回主菜單
pause>nul
goto sc_top
:sc_del
cls
echo 正在刪除
route delete -p 192.168.10.0 mask %MASK% %GATEWAY%
route delete -p 192.168.11.0 mask %MASK% %GATEWAY%
route delete -p 192.168.12.0 mask %MASK% %GATEWAY%
route delete -p 192.168.13.0 mask %MASK% %GATEWAY%
route delete -p 192.168.14.0 mask %MASK% %GATEWAY%
route delete -p 192.168.15.0 mask %MASK% %GATEWAY%
route delete -p 192.168.16.0 mask %MASK% %GATEWAY%
route delete -p 192.168.17.0 mask %MASK% %GATEWAY%
route delete -p 192.168.18.0 mask %MASK% %GATEWAY%
route delete -p 192.168.19.0 mask %MASK% %GATEWAY%
route delete -p 192.168.20.0 mask %MASK% %GATEWAY%
route delete -p 192.168.21.0 mask %MASK% %GATEWAY%
route delete -p 192.168.22.0 mask %MASK% %GATEWAY%
route delete -p 192.168.23.0 mask %MASK% %GATEWAY%
route delete -p 192.168.24.0 mask %MASK% %GATEWAY%
route delete -p 192.168.25.0 mask %MASK% %GATEWAY%
route delete -p 192.168.26.0 mask %MASK% %GATEWAY%
route delete -p 192.168.27.0 mask %MASK% %GATEWAY%
route delete -p 192.168.28.0 mask %MASK% %GATEWAY%
route delete -p 192.168.29.0 mask %MASK% %GATEWAY%
echo.
echo 刪除完成,按任意鍵查看路由表
pause>nul
cls
route print
echo.
echo 按任意鍵返回主菜單
pause>nul
goto sc_top
:sc_print
cls
route print
echo.
echo 按任意鍵返回主菜單
pause>nul
goto sc_top
:sc_madd
cls
rem //設(shè)置IP地址
echo 輸入IP地址(例如192.168.1.100/192.168.1.0)
set /p addr=
rem //設(shè)置子網(wǎng)掩碼
echo 輸入子網(wǎng)掩碼(例如255.255.255.0)
set /p mask=
rem //設(shè)置網(wǎng)關(guān)
echo 輸入網(wǎng)關(guān)(例如192.168.1.1)
set /p gateway=
echo 正在添加,請(qǐng)稍等...
rem //可以根據(jù)你的需要更改
echo IP地址 = %addr%
echo 掩碼 = %mask%
echo 網(wǎng)關(guān) = %gateway%
route add -p %addr% mask %mask% %gateway%
echo 已執(zhí)行!
echo.
echo 按任意鍵返回主菜單
pause>nul
goto sc_top
:sc_mdel
cls
rem //設(shè)置IP地址
echo 輸入IP地址(例如192.168.1.100/192.168.1.0)
set /p addr=
rem //設(shè)置子網(wǎng)掩碼
echo 輸入子網(wǎng)掩碼(例如255.255.255.0)
set /p mask=
rem //設(shè)置網(wǎng)關(guān)
echo 輸入網(wǎng)關(guān)(例如192.168.1.1)
set /p gateway=
echo 正在刪除,請(qǐng)稍等...
rem //可以根據(jù)你的需要更改
echo IP地址 = %addr%
echo 掩碼 = %mask%
echo 網(wǎng)關(guān) = %gateway%
route add -p %addr% mask %mask% %gateway%
echo 已執(zhí)行!
echo.
echo 按任意鍵返回主菜單
pause>nul
goto sc_top
:sc_reset
cls
echo 正在恢復(fù)默認(rèn)設(shè)置,請(qǐng)稍等...
netsh int ipv4 reset
echo 已恢復(fù)默認(rèn)設(shè)置!
echo.
echo 按任意鍵返回主菜單
pause>nul
goto sc_top