• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 23856
  • Last Modified:

Auto Start VPN when windows 10 starts

Hi,

I have a windows 10 Pro laptop that has a VPN connection to a remote 2008R2 server. The VPN works fine but rather than manually start the connection each time I boot my Laptop I would like it to auto start.

I've tried using Windows Task Scheduler and rasdial as described in this article but it's failing to start the connection.

It may be that the article is for Windows 7 and I'm using Windows 10 but I'm not sure, any help appreciated.

Thanks
0
DavidBurchett
Asked:
DavidBurchett
  • 6
  • 5
1 Solution
 
McKnifeCommented:
We don't know how you start the connection - do you just double click an icon (=shortcut)? If so, put that shortcut into the autostart folder. Find autostart like this:
-press winkey together with r [a run box appears]
-now enter shell:startup [and press enter :)]
A folder will appear, put it inside.
0
 
DavidBurchettAuthor Commented:
Hi McKnife,

I did look at that option but the connection is not a shortcut in Windows 10 but a menu (of sorts) on the VPN section of the Network & Internet page within the Windows 10 settings section.

Cheers
David
0
 
McKnifeCommented:
Ok, is that menu listed if you go to
winkey+r
ncpa.cpL
?
If so, can you rightclick-drag it from there to that startup folder I mentioned?
0
On-Demand: Securing Your Wi-Fi for Summer Travel

Traveling this summer?Check out our on-demand webinar to learn about the importance of Wi-Fi security and 3 easy measures you can start taking immediately to protect your private data while using public Wi-Fi. Follow us today to learn more!

 
DavidBurchettAuthor Commented:
Yep it was the same menu so I added the shortcut to the startup folder and rebooted but it only loads the "Network & Internet" page with the VPN option highlighted ready to click the "Connect" button. We're halfway there I guess but I really need it to auto connect without having to click any buttons.
0
 
McKnifeCommented:
For me it works the following way:
task scheduler action: rasdial "vpn connection"
"run only when the user is logged on"
"run with highest privileges" NOT checked
0
 
DavidBurchettAuthor Commented:
I made changes:

task scheduler action: rasdial "vpn connection" - My connection name has no spaces so not using quotes I had my VPN username and password in the arguments field so I removed them leaving just the VPN name.
I had "Run whether user is logged on or not" so I changed it to "run only when the user is logged on"
I had "run with highest privileges" checked so I unchecked it.

If I click the "Run" button for this "Selected Item" it does run the task and the VPN connects. The DOS window opens and I can see the authentication and connection happen in real time. I had to add my username and password back in to the rasdial argument to get it to work using the "Run" button

If I restart or shut down and cold boot the laptop then task manager will not run this task.
0
 
McKnifeCommented:
Sure, we forgot to set a trigger :)
Trigger: At logon.
0
 
DavidBurchettAuthor Commented:
My Trigger is "At System Startup" should I change it?
0
 
McKnifeCommented:
You should.
0
 
DavidBurchettAuthor Commented:
That fixed it!

I used "At System Startup" as my original trigger as I wanted the VPN to pre connect by the time my login script had finished but the delay using "At login" is unnoticable so I'm a happy camper :-)

Worth noting the VPN username and password does have to be present.

Many thanks
0
 
McKnifeCommented:
You're welcome.
0
 
DexterITCommented:
Legendary. Thanks Guys.  I have a (very) remote office too and just had to ship a new PC there after a lightning strike.  Didn't have time to ship the PC to me first for Domain setup as I previously have, so this one has to run with a local login.
I used scheduler to activate the VPN connection at logon using the instructions above which happens really quickly.
My only uncertainty was in the arguments box as my VPN has a worst practice name (with spaces), but my first effort worked with:
run program : C:\Windows\System32\rasdial.exe
Arguments: "MyDumbass VPN Connection Name" username Pa55word

I then scheduled another task at logon with the "delay for 15 seconds" option which runs a local copy of the domain-users start-up script to mount all the remote drives the user needs.  Runs like a dream.

Thanks for the pointer.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

On-Demand: Securing Your Wi-Fi for Summer Travel

Traveling this summer?Check out our on-demand webinar to learn about the importance of Wi-Fi security and 3 easy measures you can start taking immediately to protect your private data while using public Wi-Fi. Follow us today to learn more!

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now