Create shortcut to dial VPN connection in Windows 8

15

5

It was easy to create a shortcut that automatically dials a VPN connection in Windows 7 (e.g., see these answers). But if I create that shortcut in Windows 8, double-clicking it opens the Networks panel (and doesn't establish the connection).

How do I create a shortcut in Windows 8 that dials a VPN connection?

Bradley Grainger

Posted 2012-10-27T01:22:12.997

Reputation: 790

@Moab: That just creates a shortcut that opens the Networks panel to show the VPN connection (which I already know how to do). I want to create a shortcut that automatically connects, with no extra steps. – Bradley Grainger – 2012-10-27T03:52:13.790

Answers

24

Use the rasphone utility as documented in KB555935. Assuming your VPN connection is named "Work VPN", follow these steps:

  1. Right-click the desktop, choose New > Shortcut.
  2. Enter rasphone.exe as the location of the item; click Next.
  3. Type a name for the shortcut, e.g., "Work VPN"; click Finish.
  4. Right-click the new shortcut, choose Properties.
  5. Edit the Target to be C:\Windows\System32\rasphone.exe -d "Work VPN" (change the name to be the name of your VPN connection; to see the names of existing connections, just run rasphone.exe with no arguments).
  6. (Optional) Click Change Icon and pick a better icon; there are a few icons of networks in Shell32.dll.

Bradley Grainger

Posted 2012-10-27T01:22:12.997

Reputation: 790

My VPN credentials are saved and Windows provides them automatically without user intervention so it seems like there is something you are missing – Tim Partridge – 2014-10-15T04:48:15.393

5It's worth noting that C:\Windows\System32\rasphone.exe -h "Work VPN" can be used in a second shortcut for disconnecting the VPN connection (you can't use the -d shortcut, above, to toggle the state of the VPN connection, it can only be used to connect). – SimonTewsi – 2014-02-14T12:10:16.343

Thanks for this, but I feel the need to ask, with this setup, I know the password is saved, but it is still prompting for a user interaction to connect. Is there a way to make it not ask that or am I missing something from this instruction? – zapoqx – 2014-02-28T16:59:27.860

8

I believe you were close..

The command you were looking for is rasdial.exe

Create the shortcut on your desktop as rasdial.exe then all you need to have is the name of the network. ie... rasdial.exe "Work Network" or whatever you have called your VPN Connection.

Then put it in your Startup folder just like you would any other program you want to run on startup.

  1. Right-click the desktop, choose New > Shortcut.
  2. Enter rasdial.exe as the location of the item; click Next.
  3. Type a name for the shortcut, e.g., "Work VPN"; click Finish.
  4. Right-click the new shortcut, choose Properties.
  5. Edit the Target to be C:\Windows\System32\rasdial.exe "Work Network"

Copy the shortcut into your Startup folder: %userprofile%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\

Nathaniel Baker

Posted 2012-10-27T01:22:12.997

Reputation: 81

-1

You can also do the following steps to add a shortcut to the desktop:

  • Step 1: Right click on Network icon (wireless or wired) on task bar
  • Step 2: Left click on "Open Network and Sharing Center (menu item)"
  • Step 3: Left click on "Change adapter settings (link)" in "Control Panel\All Control Panel Items\Network and Sharing Center"
  • Step 4: Right click on "Name (edit)" in "Control Panel\Network and Internet\Network Connections"
  • Step 5: Left click on "Create Shortcut (menu item)"
  • Step 6: Left click on "Yes (button)" in "Shortcut"

Tom McMurtry

Posted 2012-10-27T01:22:12.997

Reputation: 1

This doesn't automatically dial the connection (as requested); it simply opens the Networks panel and I have to click the "Connect" button to establish the connection. – Bradley Grainger – 2013-02-18T01:42:15.730