You'd need to use Win32::API or Inline C to do this. See here where is says:
To programmatically add or modify system environment variables, add them to the HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment registry key, then broadcast a WM_SETTINGCHANGE message with lParam set to the string "Environment". This allows applications, such as the shell, to pick up your updates.
No guarentees that a pre-existing shell instance would see your changes though. You might be able to inject code into the parent process to do it, but that's nasty and awkward.
In reply to Re: Changing parent process environment variable
by BrowserUk
in thread Changing parent process environment variable
by tcf22
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |