ENVIRONMENT VARIABLE

Started by joe, October 31, 2018, 03:15:10 PM

Previous topic - Next topic

joe

Is there any way to change the path environment variable from PVX.
From the CMD prompt I can use PATH %path%;c:\joesdir\ to add to the path.
I would like to do this in my program.
I have tried Invoke ("PATH %path%;c:\joesdir\") which does not work
I have tried it in a .BAT file, no luck either.

Mike King

There is no direct method to change the environment variables nor any way to change the environment variables used by PxPlus from within your session.

When any process starts on any OS, it is passed a list of environment variables.  It can change this list for any process that it starts, but its environment variable list is basically fixed.  Changing the environment list is done by simply passing a new modified list to whatever processes you spawn.

PxPlus itself does not offer the ability to change the list of environment variables it passes to spawned processes, however you could spawn a process which would change the environment list and pass this new/modified list to a process that it spawns.
Mike King
President - BBSysco Consulting - http://www.bbsysco.com
eMail: mike.king@bbsysco.com