Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Vista Newsgroups > Vista security

Acquiring User Locations on VISTA.

Closed Thread
 
Thread Tools Display Modes
Old 08-13-2007   #1 (permalink)
Superfreak3
Guest


 

Acquiring User Locations on VISTA.

We have an .exe that fires off to read an .ini file to grab some
version information, which is in turn used to determine if our
automated update process should be fired off. The ini file we are
trying to find is located in

Users\<UserA>\AppData\Roaming\MyCompany\MyApp\

UserA is a Standard User with UAC enabled. When I attempt to fire
the .exe, I am prompted for Credentials of an Administrator. The
credentials applied are for Administrator UserB.

After applying the proper credentials, the application indicates that
the Server Share (ini location) could not be found. After doing some
debugging via log writes, I see that, after applying credentials, it
is looking in the User location of UserB (Admin used to apply
credentials). Instead of looking to the logged on user's path

I'm using SHGetSpecialFolderPath(0, Buf, CSIDL_APPDATA, 0); to get the
user folder if that leads to anything.

Is there any way in VISTA to get this to work properly for the logged
on Standard user (UserA) instead of looking to the user whose
credentials were applied to allow our .exe's execution?

If this is confusing and more clarification is needed, PLEASE let me
know and I will provide any information needed!

THANKS IN ADVANCE!!

Old 08-13-2007   #2 (permalink)
Bob Butler
Guest


 

Re: Acquiring User Locations on VISTA.

"Superfreak3" <Matt.Walker@synergis.com> wrote in message
news:1187019630.946568.62280@g4g2000hsf.googlegroups.com...
> We have an .exe that fires off to read an .ini file to grab some
> version information, which is in turn used to determine if our
> automated update process should be fired off. The ini file we are
> trying to find is located in
>
> Users\<UserA>\AppData\Roaming\MyCompany\MyApp\
>
> UserA is a Standard User with UAC enabled. When I attempt to fire
> the .exe, I am prompted for Credentials of an Administrator. The
> credentials applied are for Administrator UserB.
>
> After applying the proper credentials, the application indicates that
> the Server Share (ini location) could not be found. After doing some
> debugging via log writes, I see that, after applying credentials, it
> is looking in the User location of UserB (Admin used to apply
> credentials). Instead of looking to the logged on user's path


The user that invoked the application is irrelevent at this point. When you
entered the credentials for UserB the application was started as UserB and
that's who is running it.

> I'm using SHGetSpecialFolderPath(0, Buf, CSIDL_APPDATA, 0); to get the
> user folder if that leads to anything.
>
> Is there any way in VISTA to get this to work properly for the logged
> on Standard user (UserA) instead of looking to the user whose
> credentials were applied to allow our .exe's execution?


If the app can be revised so that it does not require elevation then it can
be run as UserA and you'll find the right INI file

If not, one option may be to split the app into 2 parts and have a front-end
which determines the path to the INI file and passes that as a command-line
argument (or whatever method you prefer) to a second app which is run as
UserB. Another option might be to have the app search for local user
profiles and prompt to select one. You could also look into trying to
determine the name of the console desktop user although is you're going to
support terminal services and other remote access types that may bring a new
set of problems.

Basically, if your app requires administrative privileges then it must be
run as an administrator username. It'd be nice if answering the UAC prompts
gave the app the new rights but kept the old username but that's not how it
works.



Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
vista .net 3.5 and trusted locations SGRing .NET General 1 03-04-2008 11:43 AM
Startup Slow on acquiring network GeraldF Vista General 2 02-13-2008 12:55 AM
WMP 11 - Error Code 1040 While Acquiring License For WMA Files Rosco Vista music pictures video 0 11-16-2007 09:18 PM
acquiring bootsect.exe or Vista install DVD iso image? Roedy Green Vista installation & setup 5 06-12-2007 08:00 PM
RE: Moving Default User (AKA My Documents) locations in Vista, how?? William Topping Vista file management 0 10-06-2006 09:04 AM








Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50