http://qs321.pair.com?node_id=658272


in reply to Changing parent process environment variable

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.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.