creating shortcuts for VPN in windows

creating shortcuts for VPN in windows

Connect to VPN in Windows 10 with one click [desktop shortcut]

In Windows 10, due to the new Settings app, you need to perform many clicks before you can connect to a VPN server. In Windows 7 or 8.1, you could create a shortcut to your VPN connection and connect to it with just one click. But Windows 10 does not allow you this. Here is a workaround.

In Windows 7, you could quickly connect to VPN using the network flyout which appears from the system tray. VPN connections were listed in the Network pane and you could just double click them!Windows-7-VPN-client-disconnectIn Windows 8.1 too, you could click the Network icon in the tray, select the VPN connection and click Connect.

However, when you do the same in Windows 10, it shows a list of network connections inside the Settings app instead. Even in that list, when you click the connection’s name, it shows an additional Settings page instead of a direct way to connect. Also, after connecting, you must close the Settings app. This is incredibly frustrating.set-up-VPN-in-Windows-10-600x405

To save your time, you might want to create a shortcut to connect to a VPN directly. Here is how it can be done.

  1. Right click the Desktop and select New – Shortcut.Windows 10 new - shortcut
  2. In the shortcut target box, type or copy-paste the following command:
    rasphone -d "VPN connection name"

    See the following screenshot:Windows 10 connect to VPN shortcut

  3. Set the desired icon and name for your shortcut.

Once you do this, just click this shortcut to connect to a VPN directly. You can pin it anywhere you want.

That’s it.

 

Winaero.com does a great job of describing how to set up the shortcut link for a VPN connection, but note that this approach will pop up a CMD console which awkwardly sits there the whole time it is connecting. Fortunately, you can turn that off by setting the Shortcut Property for “Run” as “Minimized” instead of the default “Normal Window.”

That site doesn’t address using a username/password either. If you need these, you can put them in the command, as shown below.

(Note also, you can also create a similar 2nd shortcut for disconnecting with a single click.)

Here are the two shortcuts, and you may want to look closely at the example in the screenshot below.

Connect Insecurely (this works but don't do it, see comments for why):
 C:WindowsSystem32rasdial.exe "MYVPN" username password

Connect Securely (this uses the encrypted username/password stored in VPN config):
 C:WindowsSystem32rasphone.exe -d "MYVPN"
Disconnect:
 C:WindowsSystem32rasdial.exe "MYVPN" /DISCONNECT
How to configure Single Click VPN Connection
How to configure Single Click VPN Connection. Note, this screenshot shows the insecure version, you really should use the secure version instead.

Leave a Reply

Your email address will not be published. Required fields are marked *