PxPlus User Forum

Twitter Twitter Twitter

Author Topic: ENVIRONMENT VARIABLE  (Read 1241 times)

joe

  • Silver Member
  • ***
  • Posts: 30
    • View Profile
ENVIRONMENT VARIABLE
« on: October 31, 2018, 03:15:10 PM »
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

  • Diamond Member
  • *****
  • Posts: 3811
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: ENVIRONMENT VARIABLE
« Reply #1 on: October 31, 2018, 08:25:10 PM »
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
eMail: mike.king@bbsysco.com