本帖最后由 mlc8686 于 2015-6-24 12:08 编辑
我自己乱写的,通过判断接口跳数,从而达到循环修改路由跳数。加了“for /f tokens^=2^ delims^=^" %%i in (%temp%\1.txt) do set n=%%i”
却不能运行了,麻烦大家看看是什么问题。- @echo off
- wmic nicconfig where index=14 get DefaultIPGateway /value | findstr /c:"{" >%temp%\1.txt
- for /f tokens^=2^ delims^=^" %%i in (%temp%\1.txt) do set n=%%i
- netsh interface ipv4 show interface | findstr /c:"14 1" && netsh interface ipv4 set interface "14" metric=5 | netsh interface ipv4 set interface "16" metric=1 | route change 0.0.0.0 mask 0.0.0.0 %n% metric 100 if 14 || netsh interface ipv4 set interface "14" metric=1 | netsh interface ipv4 set interface "16" metric=5 | route change 0.0.0.0 mask 0.0.0.0 %n% metric 1 if 14
- pause
复制代码
|