如何从命令行创建 Windows 拨号连接
如何从命令行在 Windows 上创建拨号连接?
我所说的“创建”并不是指如何建立现有连接,而是指如何创建新的拨号连接。常见的方法是使用新的连接向导(GUI),但我想从命令行(脚本)创建(和删除)连接。
我想仅在需要时创建拨号连接,因为如果没有可用的互联网连接,窗口会弹出一个对话框,要求使用拨号连接进行连接,这会阻止请求连接的程序。如果拨号连接不存在,则不会发生这种情况。禁用拨号连接上的“默认连接”设置不会阻止弹出该对话框。
How do I create dial-up connection on windows from the command line?
By "create" I do not mean 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).
I want to create the dial-up connection only when 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否看过 Microsoft 自己的有关使用 rasphone.exe 设置(创建)拨号连接的页面?
http://support.microsoft.com/kb/555935
我在这里看到的问题是仍然涉及点击。
这可能不是您梦想的解决方案,但对于这些部分,您可以创建一个简短的 AutoHotkey 脚本(或为整个就此而言,过程)。
Have you seen Microsoft's own page about setting up (creating) a dial-up connection using rasphone.exe?
http://support.microsoft.com/kb/555935
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 AutoHotkey script (or for the whole process, for that matter).
看一下
rasdial
,它可以创建基于您提供的参数的拨号连接。Take a look at
rasdial
which can create a dial-up connection based upon the arguments you provide.