15

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?

1
  • @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. Oct 27, 2012 at 3:52

3 Answers 3

25

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.
4
  • 5
    It'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).
    – Simon Elms
    Feb 14, 2014 at 12:10
  • 1
    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
    Feb 28, 2014 at 16:59
  • My VPN credentials are saved and Windows provides them automatically without user intervention so it seems like there is something you are missing Oct 15, 2014 at 4:48
  • Also if you want to have no prompt for Username and password make sure to "open %APPDATA%\Microsoft\Network\Connections\Pbk\rasphone.pbk in a text editor, make a backup of it Find [YOURVPNNAME] Find PreviewUserPw=1 - Change it to PreviewUserPw=0"
    – Schnaps
    Jan 19, 2022 at 8:21
9

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\

-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"
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. Feb 18, 2013 at 1:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .