This is a script I use on windows for dynamic DNS endpoints ("servers").
The big upside is that it supports multiple configurations and does not need hard-coded endpoints or "ping-endpoints".
I have tested this in win7 and win10. You might add it to the task scheduler and run this every 3 minutes or so.
Some care has to be taken as to know which user is running the script. The encrypted dpapi-binary file can only be read by the same user that created/saved the tunnels, i.e. \system.
To make it easy to maintain this patch, I have tried to stick it as close to the linux version as possible.
You could run this from "scheduled tasks" every 15min . But beware to set the right user!
Originally from: https://lists.zx2c4.com/pipermail/wireguard/2021-November/007321.html