自动连接3G拨号连接

自动连接3G拨号连接

我有一台笔记本电脑,内置 3G 调制解调器(HUAWEI Mobile Connect),在系统中显示为拨号调制解调器。当我想连接互联网时,我需要打开超级按钮栏,单击设置、网络、调制解调器和“连接”以打开桌面上的拨号对话框。当连接因某种原因中断时,我需要重复这些步骤。

有没有办法将 Windows 8 配置为在系统启动时自动(最好在后台静默)连接此调制解调器,并在连接中断时自动恢复连接?

作为为移动设备开发的操作系统,我希望它能够以某种方式管理始终在线的 3g 连接。

答案1

据我所知,有两种方法可以实现此目的:

  1. 您可以使用Connectionstab 来Internet Options指定是否想要Dial whenever a network connection is not presentAlways dial default connection

    互联网选项

  2. 通过批处理文件,使用rasdial对于拨号连接,您可以自动拨号。为了方便访问,您甚至可以尝试设置键盘快捷键来运行该批处理文件。

答案2

检查您的空中卡或其他 UMTS 加密狗是否有可用的驱动程序来实现 Windows 7 移动宽带接口。如果有这样的驱动程序,Windows 7(和 Windows 8)将能够自动连接而无需任何额外配置。此外,Windows 将能够处理高级功能,例如 SMS 和适当的信号强度指示器,而无需任何外部应用程序的帮助。请注意,这仅适用于分组交换连接(GPRS/HSPA)。如果您使用的是电路交换连接(CSD/HSCSD),则需要rasdial与放置在启动项文件夹中的自动批处理脚本一起使用。

如果您不确定您使用的是哪种连接,请查看当前配置中拨打的电话号码。如果是*99#或某种变体(*99***1#等),则这是分组交换连接。如果您拨打的是传统拨号接入号码(例如+18133860056),则这是电路交换数据连接。

答案3

是的,它可以工作,但是这是 Windows 任务计划程序的另一种解决方法

http://www.dariancabot.com/2010/11/15/automatically-connect-to-vpn-at-windows-startup/

在任务计划程序中,您可以使其在几小时或几分钟后重复并更改行为,(可能需要它,因为 USB 3G 调制解调器往往会在笔记本电脑中断开连接以节省电量)

另一个详细方法取自

http://social.technet.microsoft.com/Forums/en-US/W8ITProPreRel/thread/771eeb9a-77e6-428f-8e23-3433d1421757/

How to setup a Scheduled Task to Trigger on a VPN Disconnect
1. Click Windows8 Start and type Schedule Task (open it under Settings)
2. Click Create Task
3. Apply the following settings in the specified Tabs (italics describes each setting)
General Tab
Name: VPN Redial
For descriptive use, you can use any name you want like My Company VPN Redial....whatever.....
Select: Run whether user is logged on or not
Provided you have a password associated to your login account, this option will prevent the dos window from opening everytime the job runs. If you don't have a password, leave it and  see the notes below these steps.

Triggers Tab
Click New button
To create a new trigger we will use to activate the job when the VPN connect disconnects
Begin the task: On an Event
The job will be triggered by an Application event log entry
Select: Custom
Custom gives us the flexibility of creating a more detailed query
Click New Event Filter... button
Here is where we build the query for the trigger

Click the XML tab
This tab allows us to write our own query (even more flexible)
Check Edit query manually
To start a manual edit
Copy the following query
This query will trigger on an Application Event for RasClient with an EventID of 20226 and error codes 829 (Remote Disconnect), 629 (Client Disconnect). Copy from and including <QueryList> to </QueryList>
<QueryList>
  <Query Id="0" Path="Application">
    <Select Path="Application">*[System[Provider[@Name='RasClient'] and (EventID=20226)]] and *[EventData[Data[4]='829' or '629']]</Select>
  </Query>
</QueryList>
Click OK
Ensure Enabled is checked
Check it if it's not checked to make sure the job will be enabled
Click Ok
Actions Tab

Click New
To create an action to be performed when the job is triggered
Action: Start a program
Selection this option will allow us to start rasdial to reestablish the VPN connection
Program/script: rasdial
Should already be in path so just enter rasdial command

Add arguments (optional): "VPN Name" username password
VPN name is the name you defined for your dialup connection. Example, when you click the network icon in the system tray, the name that's listed for your VPN, make sure you enter it in exactly as displayed. Following the connect would be your username and password. Example, "MY VPN Connection" username password
Click Ok
Conditions Tab (not required unless you are using a laptop)

Uncheck: Stop if the computer switches to battery power
Settings TAB
Enable: If the task fails, restart every: 1 minute
In case there is a temporary issue re-establishing the VPN connection. You can specify whatever value you want instead of 1 minute
Attempt to restart up to: 7 times
Again in case there is a temporary issue re-establishing the VPN connection. You can specify whatever value you want instead of 7 times
Click Ok

Notes
1. Haven't really tested this much but I had configured it last night, woke up this morning to find the Event log showing 4 disconnects, and the job redialed all 4 times, VPN connection was still active.
2. In the General Tab we enabled "Run whether user is logged on or not. This is a non issue since there won't be a VPN connection when you're not logged in. What this option does since we are running a dos (rasdial) command, it prevent a dos window from opening every time the job runs so you won't be distracted if you're in the middle of something. This option only works if you have a password (which you should) associated with your account. If you don't and just allow your computer to boot to desktop, the option won't work. What I've done for people in these situations is created a little VBScript wrapper to launch the dos command to avoid the dos prompt. Not really an issue unless you're anal about it like me, you could simply deal with the Dos window opening up.
3. Again the query checks the event log for a new Entry for RasClient with an event id of 20226 containing error codes 820 or 620. you can add additional error codes by repeating the pattern. Example to also trigger on 222 and 333 you would modify the relevant part of the line as such *[EventData[Data[4]='829' or '629' or '222' or '333']]</Select>

4. I'm checking error codes because I don't want the job to be reconnected if I purposely disconnect the VPN which generates a 631 code under Event ID 20226.

类似在 Windows 登录中触发 rasdial

In triggers>select>new> in "Begin the task"> select At log on > make sure enabled is checked and press ok Done that's it

答案4

点击链接并下载应用程序 ReConnect。对我有用,加油。

相关内容