Boost logo

Boost-Build :

From: Eric Niebler (eric_at_[hidden])
Date: 2005-06-01 11:33:24

Brian Braatz wrote:
> It
>>turns out that if you lauch a cmd.exe shell as another user, then you
>>don't get these environment variables defined for some reason.
> [Brian Braatz Writes:]
> Side Note:
> Eric, I ran into this while writing security code for Win32. Basically,
> you may have a "user which has rights to do something" on a given box,
> but if the user does NOT have a profile then you see the behavior you
> mention.
> In my case, the problem was solved by manually logging into the machine
> with the other user (to make windows create a profile for you), and then
> doing the "runas". There is also an API for this (sorry not at the tip
> of my fingers).
> Basically, the profile is what engages all those files in your
> "\Documents and Settings\" dir

That's not it. This user *has* logged in and *does* have a profile. But
when I'm logged in as user2 and I run cmd.exe as user1, I don't get the
env vars.

However, I *do* get the USERPROFILE env var correctly defined, and it
points to the same place that %HOMEDRIVE%%HOMEPATH% should. Perhaps that
would be a better fallback?

Eric Niebler
Boost Consulting

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at