China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-25 04:13
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to automatically open the broadband connection when booting up? (Solved) View 11,236 Replies 46
Floor 31 Posted 2006-12-15 01:31 ·  中国 北京 联通
金牌会员
★★★★
Credits 2,902
Posts 1,147
Joined 2006-09-21 12:00
19-year member
UID 63324
Gender Male
Status Offline
Haha... Thanks brothers for adding points~ : )
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
Floor 32 Posted 2006-12-15 01:39 ·  中国 吉林 长春 联通
初级用户
Credits 46
Posts 24
Joined 2006-12-13 23:06
19-year member
UID 73425
Gender Male
Status Offline
You're welcome.
I tried again.
Actually, you don't need to change the name.
Just "rasdial 宽带连接 hechpr000 13617234"
That's okay.
It seems there are really many things to learn about batch processing.
Floor 33 Posted 2006-12-16 09:57 ·  中国 甘肃 平凉 电信
金牌会员
★★★★
Credits 4,103
Posts 1,744
Joined 2006-01-20 13:00
20-year member
UID 49241
Gender Male
From 甘肃.临泽
Status Offline
I haven't used this command yet~
Floor 34 Posted 2006-12-16 23:17 ·  中国 安徽 滁州 凤阳县 电信
新手上路
Credits 14
Posts 4
Joined 2006-04-18 13:27
20-year member
UID 54032
Status Offline
The key issue is that the connection name following rasdial must be established in advance. It doesn't matter if you enter the account password or not, but there must be that connection.
Floor 35 Posted 2006-12-17 01:01 ·  中国 浙江 温州 电信
中级用户
★★
Credits 458
Posts 196
Joined 2006-10-05 12:04
19-year member
UID 64614
Status Offline
Broadband connection: Properties - Options - Second option (prompt for name, password, certificate, etc.) is not selected.

Then put the connection in the Start Menu - Startup.

Auto-dial on boot.
Floor 36 Posted 2006-12-18 01:46 ·  中国 四川 乐山 电信
新手上路
Credits 6
Posts 2
Joined 2006-12-02 10:52
19-year member
UID 72366
Gender Male
Status Offline
It's so complicated

Broadband connection --> Properties --> Options --> Uncheck the box in front of "Prompt for name, password and certificate, etc." --> Put the shortcut into Startup

OK, done
Floor 37 Posted 2006-12-18 01:49 ·  中国 河北 廊坊 三河市 移动
金牌会员
★★★★
Credits 2,725
Posts 1,160
Joined 2006-09-23 12:00
19-year member
UID 63486
From 河北廊坊
Status Offline
Hehe, the result is indeed important, but the process of seeking knowledge is also very rewarding and touching ^_^
三人行,必有吾师焉。 学然后知不足,教然后知困,然后能自强也。
Floor 38 Posted 2007-03-13 04:25 ·  中国 北京 海淀区 IDC机房
初级用户
☆流星雨◇帅气冲天狂
Credits 24
Posts 21
Joined 2007-03-09 08:10
19-year member
UID 81176
Gender Male
From 广东
Status Offline
After reading so much, I still don't understand what everyone is talking about? It seems that it hasn't entered the main topic yet, and the problem hasn't been solved. I'm confused. I really don't understand what everyone is saying. It seems that everyone hasn't solved the problem of batch processing automatically starting up and connecting to the internet.

If that's the case, then setting up the IP route gateway is more convenient (of course, the modme needs to integrate a router, otherwise, a router needs to be equipped separately), so that it can automatically connect to the internet when starting up.

[ Last edited by yjhyxing on 2007-3-12 at 03:30 PM ]
Floor 39 Posted 2007-03-13 08:13 ·  中国 湖北 武汉 电信
初级用户
Credits 76
Posts 38
Joined 2007-03-13 02:54
19-year member
UID 81544
Gender Male
Status Offline
Just add it to the startup.
Floor 40 Posted 2007-03-13 10:59 ·  中国 湖北 潜江 电信
高级用户
★★★
Credits 894
Posts 411
Joined 2007-02-17 12:15
19-year member
UID 79697
Gender Male
Status Offline
So there are also programs for broadband connections in the command line.
@set c= 不知则觉多,知则觉少,越知越多,便觉越来越少. --- 知多少.
@for,/l,%%i,in,(1,1,55)do,@call,set/p=%%c:~%%i,1%%<nul&ping/n 1 127.1>nul


Floor 41 Posted 2007-03-13 11:15 ·  中国 湖北 潜江 电信
高级用户
★★★
Credits 894
Posts 411
Joined 2007-02-17 12:15
19-year member
UID 79697
Gender Male
Status Offline
The target of the properties of the broadband connection shortcut, which is a long string of CLSID, can it be used in the command line?
@set c= 不知则觉多,知则觉少,越知越多,便觉越来越少. --- 知多少.
@for,/l,%%i,in,(1,1,55)do,@call,set/p=%%c:~%%i,1%%<nul&ping/n 1 127.1>nul


Floor 42 Posted 2007-11-09 21:43 ·  中国 广东 深圳 电信
初级用户
Credits 38
Posts 17
Joined 2006-10-12 01:25
19-year member
UID 65383
Status Offline
@ECHO OFF
:begin
rasdial |find "No connection"
if /I %ERRORLEVEL% == 1 GOTO ok
if /I %ERRORLEVEL% == 0 GOTO err
PAUSE

:ok
ECHO Broadband is already connected.
ping/n 2 127.1>nul
ECHO About to exit...
ping/n 2 127.1>nul
EXIT

:err
ECHO Broadband is not connected.
ping/n 2 127.1>nul
ECHO Broadband is connecting...
ping/n 2 127.1>nul
GOTO start

:start
rem Please replace the content in square brackets with your content
rasdial Broadband Connection [ADSL username] [ADSL password]
ping/n 2 127.1>nul
exit

:close
rem Disconnect
rasdial/d
exit
Floor 43 Posted 2008-03-31 23:48 ·  中国 辽宁 葫芦岛 联通
新手上路
Credits 14
Posts 7
Joined 2008-03-31 21:49
18-year member
UID 114595
Gender Male
Status Offline
I succeeded in testing, and I can dial to access the Internet automatically
Floor 44 Posted 2008-04-01 00:05 ·  中国 河北 保定 移动
铂金会员
★★★★
网络独行侠
Credits 6,962
Posts 2,753
Joined 2003-04-16 00:00
23-year member
UID 1565
Gender Male
From 河北保定
Status Offline
The previous rasdial method requires establishing a broadband connection in advance. In fact, the self - established broadband connection is saved in this file:
%AllUserProfile%\Application Data\Microsoft\Network\Connections\Pbk\rasphone.pbk

So, you only need to use echo to generate a broadband connection item in this file.

By default, a broadband connection has the following content in this file:


Encoding=1
Type=5
AutoLogon=0
UseRasCredentials=0
DialParamsUID=100739171
Guid=78DD83B26121914C84696768DE1F8476
BaseProtocol=1
VpnStrategy=0
ExcludedProtocols=3
LcpExtensions=1
DataEncryption=8
SwCompression=1
NegotiateMultilinkAlways=0
SkipNwcWarning=0
SkipDownLevelDialog=0
SkipDoubleDialDialog=0
DialMode=1
DialPercent=75
DialSeconds=120
HangUpPercent=10
HangUpSeconds=120
OverridePref=15
RedialAttempts=3
RedialSeconds=60
IdleDisconnectSeconds=0
RedialOnLinkFailure=1
CallbackMode=0
CustomDialDll=
CustomDialFunc=
CustomRasDialDll=
AuthenticateServer=0
ShareMsFilePrint=0
BindMsNetClient=0
SharedPhoneNumbers=0
GlobalDeviceSettings=0
PrerequisiteEntry=
PrerequisitePbk=
PreferredPort=
PreferredDevice=
PreferredBps=0
PreferredHwFlow=0
PreferredProtocol=0
PreferredCompression=0
PreferredSpeaker=0
PreferredMdmProtocol=0
PreviewUserPw=1
PreviewDomain=0
PreviewPhoneNumber=0
ShowDialingProgress=1
ShowMonitorIconInTaskBar=1
CustomAuthKey=-1
AuthRestrictions=632
TypicalAuth=1
IpPrioritizeRemote=1
IpHeaderCompression=0
IpAddress=0.0.0.0
IpDnsAddress=0.0.0.0
IpDns2Address=0.0.0.0
IpWinsAddress=0.0.0.0
IpWins2Address=0.0.0.0
IpAssign=1
IpNameAssign=1
IpFrameSize=1006
IpDnsFlags=0
IpNBTFlags=0
TcpWindowSize=0
UseFlags=1
IpSecFlags=0
IpDnsSuffix=

NETCOMPONENTS=
ms_server=0
ms_msclient=0

MEDIA=rastapi
Port=PPPoE4-0
Device=WAN Miniport (PPPOE)

DEVICE=PPPoE
PhoneNumber=
AreaCode=
CountryCode=86
CountryID=86
UseDialingRules=0
Comment=
LastSelectedPhone=0
PromoteAlternates=0
TryNextAlternateOnFail=1


Those who are interested can simplify it. There should be quite a lot that can be simplified.
偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
Floor 45 Posted 2008-04-02 02:08 ·  中国 浙江 嘉兴 平湖市 电信
初级用户
★★
Credits 157
Posts 67
Joined 2007-05-13 11:03
19-year member
UID 88378
Gender Male
Status Offline
@echo off
set VPN_LAN=0
set adslpath="C:\Documents and Settings\All Users\Application Data\Microsoft\Network\Connections\Pbk\rasphone.pbk"
if exist %adslpath% findstr /c:"ADSL" %adslpath% ||set VPN_LAN=1

@echo %VPN_LAN%

echo set WshShell = CreateObject("WScript.Shell") >VPN_phone.VBS

if %VPN_LAN%==0 goto VPN_ADD
echo WshShell.Run "Rasphone -a" >>VPN_phone.VBS
echo WScript.Sleep 500 >>VPN_phone.VBS
echo WshShell.SendKeys "%+R" >>VPN_phone.VBS
echo WshShell.SendKeys "%+N" >>VPN_phone.VBS
echo WScript.Sleep 100 >>VPN_phone.VBS
echo WshShell.SendKeys "{BACKSPACE 10}" >>VPN_phone.VBS
echo WshShell.SendKeys "ADSL" >>VPN_phone.VBS
echo WScript.Sleep 500 >>VPN_phone.VBS
echo WshShell.SendKeys "{ENTER}" >>VPN_phone.VBS
echo WScript.Sleep 500 >>VPN_phone.VBS

:VPN_ADD
echo WshShell.Run "Rasphone -d ADSL" >>VPN_phone.VBS
echo WScript.Sleep 500 >>VPN_phone.VBS
echo WshShell.AppActivate "连接 ADSL" >>VPN_phone.VBS
echo WshShell.SendKeys "{TAB}" >>VPN_phone.VBS
echo WshShell.SendKeys "{TAB}" >>VPN_phone.VBS
echo WshShell.SendKeys "{TAB}" >>VPN_phone.VBS
echo WshShell.SendKeys "%+u" >>VPN_phone.VBS
echo WScript.Sleep 100 >>VPN_phone.VBS
echo WshShell.SendKeys "{BACKSPACE 10}" >>VPN_phone.VBS
echo WScript.Sleep 100 >>VPN_phone.VBS
echo WshShell.SendKeys "jxphayujh" >>VPN_phone.VBS
echo WScript.Sleep 100 >>VPN_phone.VBS
echo WshShell.SendKeys "{TAB}" >>VPN_phone.VBS
echo WScript.Sleep 500 >>VPN_phone.VBS
echo WshShell.SendKeys "{BACKSPACE 10}" >>VPN_phone.VBS
echo WScript.Sleep 500 >>VPN_phone.VBS
echo WshShell.SendKeys "密码" >>VPN_phone.VBS
echo WshShell.SendKeys "{TAB}" >>VPN_phone.VBS
echo WScript.Sleep 100 >>VPN_phone.VBS
echo WshShell.SendKeys "%+c" >>VPN_phone.VBS

start VPN_phone.VBS


I wrote this to create and dial, preventing repeated creation error issues.

[ Last edited by tvzml on 2008-4-2 at 02:09 AM ]
Forum Jump: