Auto Connect a VPN on Windows 10 at Start Up

06/17 1 min read

Here’s a handy little command for a .bat file for those of you that may use a VPN, and would like to forget about having to automatically enable it.

rasdial myVPN

Open up Notepad and paste the above in, and make sure you replace myVPN with the name of your VPN connection, save the file as .bat into your Start-up folder. You should find the Start-up folder here on Windows 10, obviously just replace USERNAME with your Windows Username.

C:\Users\USERNAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

Then, next time you are starting up, you’ll see a command prompt window pop-up and you’ll see it logging into the VPN, and your good to go.


I'm a technology professional who's been passionate about computers since my Grandad introduced me to an Intel 386 back in the 90s when I was a kid. Those moments inspired a passion within for technology, and I've been playing around with anything with a circuit board ever since. Whenever I have a moment you can probably find me working on something computer-related, and this is where I like to write about those moments.