Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 3 down vote accepted

I was able to do it with the rasdial command

rasdial /disconnect
rasdial connection_name user pass /

Source: Microsoft resources and some guy.

share|improve this answer

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

Your Answer


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.