Re: Get current windows profile name by ashwinrecwvm
ashwinrecwvm
Thu Jun 08 02:36:53 CDT 2006
Thanks for ur replies..
Actually my problem is with windows vista.
I log into vista machine with a non admin user account and try to
install some software.
Installation of this software writes some data to windows user profile.
But in vista, this installer asks for admin user's credentials. The non
admin user will provide some admin user's credentilas. Then this
installer will run under that admin users context and the installer
writes into the admin users profile.
I have to get the actual user who started the installation (Non admin
user in the above case).
adebaene@club-internet.fr wrote:
> ashwinrecwvm@gmail.com a =E9crit :
>
> > I think this GetUserNameEx() will return the user name associated with
> > the calling thread.
> >
> > If I am logged on as user X and start a process using run as cmd with
> > user Y and use this GetUserNameEx() then i will get Y as output.
> >
> > How to get the logged on user( X in the above case) ??
>
> This questin doesn't make much sense in regard too Fast User Switching
> and Remote Desktop (both ow which allow to have several users looged in
> at the same time). Also, what if you "parent proces" is a service?
>
> Perhaps what you're after is GetProcessWindowStation ->
> GetUserObjectInformation(UOI_USER_SID), but you should you explain what
> you are trying to achieve, so that we ma come up with a better
> solution...
>=20
> Arnaud
> MVP - VC