Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using Win 7's built-in VPN client but every time I put my computer to sleep / hibernate mode and then wake it up again, the connection is lost and I need to reconnect manually. Is there any way to automate it? Wireless connections have a nice little checkbox ("automatically connect when this network is in range") but I couldn't find anything similar for VPN connections. Task scheduler maybe?

share|improve this question

Okay I had the same exact "problem", do like this (translated). Make a scheduled event with the following options:

Set triggers:

  1. When connected to a user session (or similar), At login and When unlocking workstation.
  2. Certain user [yourcomputer\username] (optional but recommended)
  3. Connection from the local computer
  4. Activated

Set actions:

  1. Start a program
  2. Program or script: rasdial
  3. Argument: "the VPN Connection name" your_username your_password (with quotes)

If you would like extra security skip entering the password in the previous step. This is however only a bit insecure if someone else is sitting at your computer and opens up this dialog they can see your login detail.. You will however then always have to enter the password manually (I'm not sure if a dialog shows up though but it might).

Edit: Seems like this only works for when you use "switch user". I've added Triggers: "At login" and "When unlocking the workstation". Hopefully this covers all possible scenarios. I've also added a 30 second delay on Switch user and At Login so it doesn't try before there is a network connection available.

share|improve this answer

Apparently Windows 7 does VPN Reconnect.
This article might help : Remote Access Step-by-Step Guide: Deploying Remote Access with VPN Reconnect.

share|improve this answer
Nice tip, although it won't probably work for sleep/hibernate scenario. From the document: "If your laptop hibernates when you close the lid, then the connection is lost and you will have to manually reinitiate the connection" – Borek Sep 1 '09 at 21:43

You must log in to answer this question.

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