自动添加静态路由
-----------打开TXT,以下内容另存为.bat文件后执行------------------- @echo off & Setlocal enabledelayedexpansion color f9 Title 命令 :begin cls echo 请选择操作: echo 1、添加内网路由 echo 2、删除内网路由 echo 3、退出 set /P Choice= 请输入要执行操作的数字,然后回车: If not "%Choice%"=="" ( If "%Choice%"=="1" (goto :add) else If "%Choice%"=="2" (goto :del) else If "%Choice%"=="3" (exit) else (echo 输入错误请重新输入) ) pause >nul goto :begin :add cd . >c:\ip.txt for /f "tokens=2 skip=2 delims='[]'" %%i in ('nbtstat -n') do ( set "ip=%%i" echo !IP! >>c:\ip.txt ) for /f "tokens=1-4 delims=." %%a in (c:\ip.txt) do ( set "mask=%%a.%%b.%%c" if /I !mask! EQU 192.168