Set Windows Environment Variable

Magnus Lycka lycka at carmen.se
Thu Mar 30 10:37:05 EST 2006


Duncan Booth wrote:
> Fuzzyman wrote:
>> In the ``win32api`` package there is a ``GetEnvironmentVariable``
>> function, but no ``SetEnvironmentVariable``. Any options ?
> 
> No, your only option is to find a solution which doesn't involve changing 
> another process's environment.

Surely there must be a way to programatically set up the
environment variables for not yet started processes? I.e.
doing the same as when you manually change things in the
control panel. I'm pretty sure many Windows installers do
that, and while I suppose this is technically a registry
manipulation, I suspect there is a more direct API somewhere.



More information about the Python-list mailing list