Windows 7 default VPN - Single Click to Connect

You can use rasphone.exe to dial a connection using stored credentials:

rasphone -d "VPN NAME"

Hangup with:

rasphone -h "VPN NAME"

You'll also need to go into the option tab of the properties for your VPN connection and uncheck "Prompt for name and password, certificate, etc."


Create a .bat file with following command:

%windir%\system32\rasdial.exe "VPN NAME" /DOMAIN:

"VPN Name" would be the VPN connection name that you have given under Networking and Sharing Center. Quotes are required.

UserID and Password are required even if you have set the option to save your credentials.

Once the batch file is created you can assign a keyboard shortcut for instant access.

For disconnection, create another batch file with below command:

%windir%\system32\rasdial.exe "VPN NAME" /DISCONNECT