Arguments to connect using Open Vpn windows client

Solved it as below:

from windows command prompt-

enter image description here

This is going to start the opn vpn gui client directly connecting to the connection specified in the config.


Mind you that if the openvpn-gui.exe is already started above answers won't work. Pay attention to the :run section from a little batch file I made to automatically start openVPN connection when not at home:

rem This script is fired from Task Scheduler (using Custom Event filter) when I am NOT at home (not connected to home network)
rem  so check if my home NAS is already pingable, because maybe old/previous OpenVPN connection is still open
rem    if not then start OpenVPN connection
rem    if yes than do nothing
ping -n 1 192.168.10.100 > testping.txt
findstr /r /c:"Reply from \d*.\d*.\d*.\d*.* bytes=\d*.*time[<=]\d*.* TTL=\d*" testping.txt
IF ERRORLEVEL 1 goto run
rem do nothing because NAS is pingable
goto finished
:run
rem be sure to kill previous (closed) openvpn process so reconnecting actually works!
taskkill.exe /F /IM openvpn.exe
taskkill.exe /F /IM openvpn-gui.exe
timeout 1
start /b "" "C:\Program Files\OpenVPN\bin\openvpn-gui.exe" --connect nas_at_home.ovpn
:finished

In additional to Flowerking's answer, you could specify the folder in which your ovpn file lives, perhaps to store private key data in user space. For that, use config_dir:

openvpn-gui.exe --connect "client.ovpn" --config_dir "C:\Users\Foo\Documents\protected_crypto_data"

Tags:

Vpn

Openvpn