This is the sixth part of the Availability Anywhere series. For your convenience you can find other parts in the table of contents in Part 1 – Connecting to SSH tunnel automatically in Windows

There is some bug with Task Scheduler not running the task on the next run date, similar to this question. In my case it was happening on Windows 10 Home edition on two different machines. I checked multiple solutions and none of them worked for me, the task was configured correctly but it wasn’t triggered.

I finally gave up and changed the script. Because I wanted to trigger a bat file every minute, I just changed the script. Previously I had a script VPN.bat which was triggered every minute to reconnect the VPN and configure the DNS. Now, I changed it to this:

So I just run this script which works indefinitely and starts the other script. Now, it is important that the other script has explicit exit in it to avoid leaking cmd.exe instances.

Then I changed Task Scheduler to run the script on system startup. I also chose rerunning it every minute and not running in parallel, but it doesn’t matter as Task Scheduler doesn’t trigger it correctly.