[Tutor] accessing another system's environment

Dave Angel davea at ieee.org
Sat Feb 26 12:52:18 CET 2011


On 01/-10/-28163 02:59 PM, Steve Willoughby wrote:
> On 26-Feb-11 01:19, ALAN GAULD wrote:
>> Bill,
>>
>> That's the same thing we are talking about.
>> The problem is those environment variables are
>> highly variable so you can't talk about a machine's environment.
>> Two users on the same machine (at the same time) may have
>> very different environments. And a batch file or program can
>
> I'm a Unix hacker, so forgive me if my understanding of Windows is a bit
> naive. I think, though, that Windows has a set of environment variables
> which are system-wide, added automatically to the user set of variables
> when a new process is launched. Yes, they can be changed or deleted but
> there is a standard set applied to all users.
>
> If that's a correct assumption on my part, there must be somewhere that
> can be read from, probably (I would guess) in the registry. So a script
> which could read/write those registry keys may do what is required here.
>
> The issue of exposing that to remote machines remains a dangling issue,
> though.
>
> Of course, it's not entirely clear we're solving a Python question,
> although this discussion may well go more solidly into that space.
>

Indeed.  in Windows, there are two sets of registry keys for environment 
variables, one is system wide, and one is per user.  When Explorer 
launches a console or an application for a particular user, it combines 
those two sets of keys to come up with an initial set of environment 
variables.

I tried to launch a VirtualBox XP machine, but it failed for some 
reason.  Probably I have too much else running.  So I can't tell you the 
key names.

I'd suggest asking about remotely accessing the registry on the 
python-win32 forum.  I'm sure the win32 extension have a way, I just 
don't know if it'll work from a Linux client.

DaveA


More information about the Tutor mailing list