From: Eric Niebler (eric_at_[hidden])
Date: 2005-06-01 11:33:24
Brian Braatz wrote:
>>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
> 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
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 www.boost-consulting.com
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk