0

I have managed to do what I want using this awful two lines code:

cd "C:\Program Files\OpenVPN\bin" 
start openvpn.exe --config Netherlands1-UDP.ovpn --auth-user-pass info

I would like to do it in one line. It seems easy but it doesn't work. Maybe it's because of the space in "Program Files".

Gryz
  • 63
  • 1
  • 4
  • See this answer https://stackoverflow.com/a/76919567/185565 how to use a cmdine and also provide a custom config file folder. You don't need to copy open files inside the openvpn installation folder. – Whome Aug 17 '23 at 08:17

2 Answers2

0

To run a command all in one line, it would be something like:

cd "C:\Program Files\OpenVPN\bin" && start openvpn.exe --config Netherlands1-UDP.ovpn --auth-user-pass info
Omar2535
  • 78
  • 1
  • 10
  • 1
    Ideally, I would like something like ` start "C:\Program Files\OpenVPN\bin\openvpn.exe" --config Netherlands1-UDP.ovpn --auth-user-pass info` – Gryz Jul 25 '21 at 18:29
  • Post the error that you're getting. Also, try without the `start` word – Omar2535 Jul 25 '21 at 18:33
  • It just does nothing, when I open the bat file it closes the window instantly – Gryz Jul 25 '21 at 20:27
0

Make sure the OpenVPNServiceInteractive is running, because from its description :

It allows OpenVPN GUI and other clients to establish OpenVPN connections without administrative privileges in a secure way.

Youssef
  • 132
  • 2
  • 2
  • 10