Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can I change my VPN connection settings in Windows 7 from the command line? I know how to do it using the GUI but I really need to do it from the console.

I need to change the user, password and internet address and then restart the connection. It doesn't matter if I have to install some third-party software in order to do this (from the command line).

share|improve this question
    
What sort? PPTP? –  paradroid Apr 13 '12 at 23:02
    
Ups... yes, PPTP. –  Ivan Castellanos Apr 14 '12 at 6:23
add comment

2 Answers 2

up vote 2 down vote accepted

I was able to do it with the rasdial command

rasdial /disconnect
rasdial connection_name user pass /phone:host.example.com

Source: Microsoft resources and some guy.

share|improve this answer
add comment

I have not got a PPTP connection set up to test this at the moment, but you could try making two connections in %userprofile%\AppData\Roaming\Microsoft\Network\Connections\Pbk\. The default connection is rasphone.pbk.

You could just execute them using the full path from the commmand line, but I am not sure if the first one automatically disconnects when you use the second one, as I cannot test it.

share|improve this answer
    
Your comment pointed me in the right direction but it was not an accurate solution for my problem. –  Ivan Castellanos Apr 15 '12 at 22:41
    
@IvanCastellanos: That's okay - I didn't expect it to be. –  paradroid Apr 16 '12 at 0:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.