Windows 7 default VPN – Single Click to Connect

l2tppptpvpnwindows 7

The default way to connect to a VPN (standard includedd MS client) seems to be to click on the network icon in the system tray to expand it, then pick the VPN connection, and click the connect button. This brings up a dialog where you can enter your username and password.

I have told the VPN connection to remember my credentials. Is there some way I can skip that dialog and just have it connect?

I have tried using rasdial.exe, and I can connect as long as I pass the username and password as arguments. It doesn't seem to want to use the stored credentials for some reason, maybe I need to store them with an elevated account.

Best Answer

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."

Related Question