Failed running command (--up/--down): returned error code 1

How to customize and extend your OpenVPN installation.
Post Reply
SGWW
OpenVpn Newbie
Posts: 7
Joined: Tue May 20, 2014 11:17 am

Failed running command (--up/--down): returned error code 1

Post by SGWW » Wed Apr 11, 2018 1:38 pm

Hello guys!

Have a little issue with OpenVpn scripting under Windows 10, it looks very simple, just cant run a simple bath script. Mb somebody can tell me what I am doing wrong. Thanks in advanced.

Here is OpenVpn client config:

Code: Select all

client
dev tun
proto tcp
remote vpnserver.net 443 
script-security 2
up "C:\\Program\ Files\\OpenVPN\\config\\test.bat"
nobind
auth-user-pass
comp-lzo
reneg-sec 0
persist-key
cipher AES-256-CBC
verb 4
remote-cert-tls server
<ca>
Here is the script test.bat

Code: Select all

SET logfile=%USERPROFILE%\secretvpn.log
echo script starts on %DATE% at %TIME% >> %logfile% 2>>&1
And the log output:

Code: Select all

****
Wed Apr 11 15:43:31 2018 us=217110   up_script = 'C:\Program Files\OpenVPN\config\test.bat'
****
Wed Apr 11 15:43:31 2018 us=217110 OpenVPN 2.4.5 x86_64-w64-mingw32 [SSL (OpenSSL)] [LZO] [LZ4] [PKCS11] [AEAD] built on Mar  1 2018
Wed Apr 11 15:43:31 2018 us=217110 Windows version 6.2 (Windows 8 or greater) 64bit
Wed Apr 11 15:43:31 2018 us=217110 library versions: OpenSSL 1.1.0f  25 May 2017, LZO 2.10
****
Wed Apr 11 15:43:38 2018 us=408998 do_ifconfig, tt->did_ifconfig_ipv6_setup=0
Wed Apr 11 15:43:38 2018 us=408998 MANAGEMENT: >STATE:1523450618,ASSIGN_IP,,10.8.9.50,,,,
Wed Apr 11 15:43:38 2018 us=408998 C:\Program Files\OpenVPN\config\test.bat Ethernet 3 1500 1555 10.8.9.50 10.8.9.49 init
Wed Apr 11 15:43:38 2018 us=408998 env_block: add PATH=C:\WINDOWS\System32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
Wed Apr 11 15:43:38 2018 us=455874 MANAGEMENT: Client disconnected
Wed Apr 11 15:43:38 2018 us=455874 WARNING: Failed running command (--up/--down): returned error code 1
Wed Apr 11 15:43:38 2018 us=455874 Exiting due to fatal error
That it

SGWW
OpenVpn Newbie
Posts: 7
Joined: Tue May 20, 2014 11:17 am

Re: Failed running command (--up/--down): returned error code 1

Post by SGWW » Thu Apr 12, 2018 6:02 pm

Can somebody check this? Looks like this client scripring feature does not work with windows. I am able to run scripts with OpenVPN GUI scripting, but not with OpenVPN config directives.

briand
OpenVpn Newbie
Posts: 2
Joined: Mon Apr 23, 2018 1:24 pm

Re: Failed running command (--up/--down): returned error code 1

Post by briand » Mon Apr 23, 2018 8:19 pm

Code: Select all

up "C:\\Program\ Files\\OpenVPN\\config\\test.bat"
That path is not correct surely you mean

Code: Select all

up "C:\\Program Files\\OpenVPN\\config\\test.bat"

Post Reply