中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-09-23 14:52
47,812 topics / 349,917 posts / today 0 new / 48,273 members
DOS批处理 & 脚本技术(批处理室) » How to use batch processing to make an automatic connection
Printable Version  2,201 / 2
Floor1 liuye851 Posted 2011-01-12 16:37
新手上路 Posts 1 Credits 2
I need to execute the following command at boot time
route add 192.168.1.119 mask 255.255.255.255 200.200.200.5 if 0x10006
0x10006 is the interface number of WAN (PPP/SLIP)

The question is
1. As soon as the power is cut off, the 0x10006 interface number will also disappear. When the power is re - powered on, is the command "route add 192.168.1.119 mask 255.255.255.255 200.200.200.5 if 0x10006" still valid?

2. If it is invalid, then how to make the batch processing automatically add the command "route add 192.168.1.119 mask 255.255.255.255 200.200.200.5 if 0x10006" as soon as 0x10006 appears?
Floor2 eminjin Posted 2011-01-14 16:41
新手上路 Posts 10 Credits 10
First, print all interfaces using route print, then use findstr to find the corresponding lines. Then intercept the interface number. Hmm, that should be the idea, right?
Floor3 eminjin Posted 2011-01-14 16:53
新手上路 Posts 10 Credits 10
```
for /f "tokens=1 delims= " %%i in ('route print ^| findstr -i /C:"WAN(PPP/SLIP)"') do echo %%i
```

[ Last edited by eminjin on 2011-1-14 at 16:58 ]
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023