2012-01-06 131 views
0

如何从命令行在Windows上创建拨号连接?如何从命令行创建Windows拨号连接

通过“创建”我做意味着如何建立的现有连接,但如何创建一个新的拨号连接。常用的方法是使用新的连接向导(GUI),但我想从命令行(脚本)创建(并删除)连接。

我要创建拨号连接只有在需要的时候,因为如果没有互联网连接可用的窗口会弹出一个对话框,询问使用拨号连接,阻断程序请求连接来连接。如果拨号连接不存在,则不会发生这种情况。禁用拨号连接上的“默认连接”设置不会阻止对话框弹出。

+0

至于你的第二段,我特别记得一个选项“永不拨号连接”,只能从控制面板的Internet设置或IE的右键菜单中获得。从拨号网络连接设置窗口无法访问,也无法访问调制解调器属性。 – Marcos 2014-02-27 17:57:14

+0

像这样:http://superuser.com/a/435817/110335 – Marcos 2014-02-27 18:21:33

回答

0

查看rasdial,它可以根据您提供的参数创建拨号连接。

+0

谢谢,但rasdial _cannot创建一个新的拨号连接。使用rasdial,您可以建立(或关闭)现有的拨号连接,并可选择提供新的电话号码或用户凭据,但无法创建新的拨号连接。 – Adam 2012-01-07 19:10:43

0

您是否看到过微软自己的关于使用rasphone.exe设置(创建)拨号连接的页面?

http://support.microsoft.com/kb/555935

How to setup dial-up connection by rasphone.exe command 
Click Start, type rasphone -a in the Start Search box, and then press Enter key. 
Click Dial-up button on the How do you want to connect page. 
Type the telephone number and destination name(e.g. Dial-Up), on the Type the telephone number to connect to page, click Next button to continue. 
Type your user name and password, and make sure the Remember this password check box has been selected, on the Type your user name and password page, click Create button to continue. 
Click Start, type rasphone -e <destination name> in the Start Search box, and then press Enter key. 
Note: you must use the destination name which typed in step3, for example, Dial-Up. 
On the Options tag of the Dial-up Properties, Clear the following selection: 
a. Prompt for name and password, certificate, etc. 
b. Include Windows logon domain. 
c. Prompt for phone number. 
then click Ok button. 

我在这里看到的问题是,它仍然涉及点击。 这可能不是您梦寐以求的解决方案,但对于这些部分,您可以创建一个简短的AutoHotkey脚本(或针对​​整个过程)。