How can I disconnect from openvpn in windows via command line?

press F4 (it's listed in the title bar of the command window).


Its looks like openvpn doesnot have disconnect option. But you can use taskkill command to disconnect the vpn connection. I have tested myself. It is properly disconnecting instead of abruptly killing openvpn.

taskkill.exe /F /IM openvpn.exe


The above answers didn't work for me. The question is about Windows XP, but I thought I would answer for Windows 10 anyway.

You can now run the GUI program with a large number of options. To disconnect a specific client execute the following (this worked in October 2019 with OpenVPN version 11.10 64bit)

"c:\Program Files\OpenVPN\bin\openvpn-gui.exe" --command disconnect <client-name>

Or disconnect all connections, regardless of name

"c:\Program Files\OpenVPN\bin\openvpn-gui.exe" --command disconnect_all

Many other options are also available

enter image description here