Enable/Disable WireGuard from Windows Command Line

How to enable and disable Wireguard from the command line on Windows.

With everything setup normall in the UI and working, the following commands will enable/disable a WireGuard connection.

Enable WireGuard

The following must be Run as Admin. Replace NAME_OF_CONNECTION with the name of the connection

& "C:\Program Files\WireGuard\wireguard.exe" /installtunnelservice "C:\Program Files\WireGuard\Data\Configurations\NAME_OF_CONNECTION.conf.dpapi"

Disable WireGuard

The following must also be Run as Admin. Replace NAME_OF_CONNECTION with the name of the connection.

& "C:\Program Files\WireGuard\wireguard.exe" /uninstalltunnelservice "NAME_OF_CONNECTION"