2012-01-06 129 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腳本(或針對​​整個過程)。