Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: Changing parent process environment variable

by BrowserUk (Patriarch)
on Dec 20, 2007 at 21:22 UTC ( #658272=note: print w/replies, xml ) Need Help??

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.
  • Comment on Re: Changing parent process environment variable

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://658272]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2023-02-01 11:41 GMT
Find Nodes?
    Voting Booth?

    No recent polls found