Automatically start and log into VPN on Windows Startup

To connect to a VPN with Windows, after you have acquired VPN access (either commercially or a free one) you generally might want to use it/log into it. This means every time the VPN should be used a login into some third-party software or some handling of the Windows integrated software is necessary (i.e. choosing connection, inputting username/password). This challenge is to present a solution so that the computer automatically does this process for you on startup.
1 answer

Use rasdial in Windows 7 Task Scheduler

The proposed solution consists of two steps.

  1. Creation of VPN connection
  2. Scheduling of task

For this solution you will need a VPN connection in Windows' integrated service (you need to have login data for a VPN service for this)
This is accessed via the Control Panel under Network and Internet -> Network and Sharing Center.

  • Click 'Set up a new connection or network'
  • Choose 'Connect to a workplace'
  • Choose 'Use my Internet connection'
  • Input the VPN's internet address and a name of your choosing for the connection (you will need this name later on)
  • Input your login credentials

Now you should be able to log into your VPN.

Once thats done we set up an automatic task in the task scheduler:

  • Click the start button
  • Click Control panel
  • Click System and Maintenance
  • Click Administrative Tools
  • Double-click Task Scheduler

Now that we have accessed the task schedular we create a new task:

  • Click 'create task' on the right and a window opens
  • There input a name for your task
  • Switch to the Trigger tab
  • Click on 'New'
  • From the dropdown menu choose 'at startup'
  • Check 'enabled' at the bottom and confirm with 'OK'
  • Switch to the Actions tab
  • Click on 'New'
  • From the dropdown menu choose 'Start a program'
  • In the field 'Program/script' write "rasdial"
  • In the field 'Add arguments' write "name_of_connection username password" (keep the " and replace with your login credentials)
  • Confirm by clicking OK twice
  • Now the VPN connection should always be established at startup