

Leave * for askingĮcho "VPN already connected.
#OPENVPN AUTO CONNECT WINDOWS 10 PASSWORD#
Then, for the vpn you can put your password (in clear!) or leave set mypass="*" to ask for the password everytime. That's because I put a runas with the /savedcred argument which will ask only once for the password and then it will work automatically. The only "problem" is the route command needs to be launched with elevated privileges. I made a batch file using rasdial which works like a charm. so, sadly decided to look for an alternative. See this screenshot (sorry, the screenshot is in spanish):įinally I couldn't make it work. maybe everything is set up but something is blocking the trigger.
#OPENVPN AUTO CONNECT WINDOWS 10 INSTALL#
I noticed in event viewer that always, after a successful VPN connection (id 20225) there is always another event (id 900) which can be related. I got this working by using the 'classic' OpenVPN Windows app, choosing the option to install the Windows service during installation, putting my configuration and auth file in the 'auto-config' folder and going into services and disabling the 'interactive' service and enabling the standard service for automatic startup. I tried to change the trigger part to change "Basic" to "Custom" and I put a XPath filter in XML field trying to search for the event id: You can check for the VPN option availability by clicking on the network icon and locating the VPN. But the task scheduler is working fine, other tasks can be scheduled or executed manually and they are working. AutoVPN in Windows 11/10 Before getting started, there are certain conditions to be met.

Task Scheduler will attemt to reconnect to it". And if I try to launch it manually, it says "Task Scheduler service is not available. I did the task with elevated privileges with the same result, and marked the "Execute with elevated privileges" checkbox as well. Of course, before trying all of this stuff, I tried to creating the route "persistently" using -p parameter on route command but it doesn't work because the VPN interface doesn't exist when this route is added on every boot, so is not a valid option. why is not triggering the route command? I can see the 20225 events with RasClient as source in the application event viewer after connecting the VPN. Automating this task means you won't even have to think about connecting to a VPN when you use certain apps. I investigated and the Windows event 20225 is still the same on W10 (RAS Connection Establishement). With Windows 10's PowerShell cmdlet, you can easily add applications to automatically trigger a VPN connection when they launch.


I had similar problem in a business environment.
