al03 / chnroutes

Automatically exported from code.google.com/p/chnroutes
0 stars 0 forks source link

WIN7 PPTP “路由添加失败: 参数错误” 的解决方案 #31

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
由于WIN7的route print输出结果发生了变化,如下所示:

网络目标        网络掩码          网关       接口   跃点数
 0.0.0.0          0.0.0.0            在链路上    123.231.123.123    434

因此,在vpnup.bat批处理文件,第3行的如下命令会错误获取信�
��:
for /F "tokens=3" %%* in ('route print ^| findstr "\<0.0.0.0\>"') do set 
"gw=%%*"

在WIN7下运行此批处理命令获取的字符串会是 
'在链路上',而不是网关IP地址。

解决方案:
编辑vpnup.bat批处理文件,将上述命令中的 "tokens=3" 更改为 
"tokens=4"。

Original issue reported on code.google.com by cczh...@gmail.com on 21 Mar 2011 at 5:11

GoogleCodeExporter commented 9 years ago
感谢 :-)

Original comment by Pokemon....@gmail.com on 29 Aug 2011 at 1:19

GoogleCodeExporter commented 9 years ago
thx

Original comment by kjlam...@gmail.com on 24 Mar 2012 at 10:53

GoogleCodeExporter commented 9 years ago
感謝,解決了。

Original comment by TChung...@gmail.com on 13 Nov 2012 at 3:10

GoogleCodeExporter commented 9 years ago
thx 

Original comment by ericro...@gmail.com on 19 May 2013 at 9:26

GoogleCodeExporter commented 9 years ago
感谢

Original comment by nkzx...@gmail.com on 1 Mar 2014 at 5:17

GoogleCodeExporter commented 9 years ago
thx

Original comment by lxja...@gmail.com on 7 Jun 2014 at 1:39

GoogleCodeExporter commented 9 years ago
厉害。。

Original comment by zhenglun...@gmail.com on 3 Sep 2014 at 6:32

GoogleCodeExporter commented 9 years ago
感谢!win8成功。但是ikev2好像不适用了。。。

Original comment by shen...@gmail.com on 16 Oct 2014 at 1:30