如何从命令行创建 Windows 拨号连接
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8756501/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
how-to create a windows dial-up connection from the command line
提问by Adam
How do I create dial-up connection on windows from the command line?
如何从命令行在 Windows 上创建拨号连接?
By "create" I do notmean how to establish an existing connection, but how to create a new dial-up connection. The common way is to use the new connection wizard (GUI), but I want to create (and delete) the connection from the command line (script).
我所说的“创建”不是指如何建立现有连接,而是指如何创建新的拨号连接。常用的方法是使用新建连接向导(GUI),但是我想从命令行(脚本)创建(和删除)连接。
I want to create the dial-up connection onlywhen needed, because if no internet connection is available windows pops up a dialog asking to connect using the dial-up connection, which blocks programs requesting a connection. This does not happen if the dial-up connection does not exist. Disabling the "default connection" setting on the dial-up connection does not prevent the dialog to pop up.
我想创建拨号连接,只有在需要的时候,因为如果没有互联网连接可用的窗口会弹出一个对话框,询问使用拨号连接,阻断程序请求连接来连接。如果拨号连接不存在,则不会发生这种情况。禁用拨号连接上的“默认连接”设置不会阻止对话框弹出。
回答by Alex K.
回答by Marcos
Have you seen Microsoft's own page about setting up (creating) a dial-up connection using rasphone.exe?
您是否看过 Microsoft 自己的关于使用 rasphone.exe 设置(创建)拨号连接的页面?
http://support.microsoft.com/kb/555935
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.
The trouble I see here is that it still involves clicking. This may not be your dream solution, but for those parts, you could create a short AutoHotkeyscript (or for the whole process, for that matter).
我在这里看到的麻烦是它仍然涉及点击。这可能不是您梦想中的解决方案,但对于这些部分,您可以创建一个简短的AutoHotkey脚本(或者对于整个过程,就此而言)。