Page 1 of 1

Environment vars are not being resolved?

Posted: Sat Jan 12, 2019 9:53 pm
by NullDevice
Hello!

Did anyone have the problem yet that on the windows openvpn client, the up and down scripts cannot resolve environment variables?

I mean i have a file called "up.bat" , and when i run it manually, everything is working fine.
When OpenVPN runs it after successful connect, then variables like %USERPROFILE% are treated like the string "%USERPROFILE%" and are not resolved.

I do have "script-security 3" in my config. I guess this is right?

My version is OpenVPN GUI (Windows) v 11.10.0.0

ND

Re: Environment vars are not being resolved?

Posted: Sat Jan 12, 2019 10:01 pm
by TinCanTech
Like Linux, Windows does not inherit your environment ..
The common way people discover this is because scripts do not have access to $PATH.

Although, that's only a guess ..

Re: Environment vars are not being resolved?

Posted: Sun Jan 20, 2019 5:08 pm
by NullDevice
Yes, seems its exactly that problem.
Is there are workaround? How do others use script with env.vars then normally?

Re: Environment vars are not being resolved?

Posted: Sun Jan 20, 2019 10:54 pm
by TinCanTech
NullDevice wrote:
Sun Jan 20, 2019 5:08 pm
Is there are workaround?
You mean, like a bug ?

Re: Environment vars are not being resolved?

Posted: Sat Jan 26, 2019 10:17 am
by NullDevice
No, i mean tuning to OS to do exceptions for scripts or something like that. There are plenty of other applications using environment variables with scripts. F.e. Cisco AnyConnect VPN client. Scripts with environement vars are working there. So there must be a possiblity.