-
March 18th, 2008, 11:05 AM
#1
UAC turned off + administrator required
Hi all,
I want to launch an application on Vista which requires administrator rights (but has the asInvoker manifest option). However, when UAC is disabled, I cannot elevate the process using runas in shellexecute.
How should I run an application as administrator when UAC is turned off / disabled?
Thanks!
-
March 18th, 2008, 01:55 PM
#2
Re: UAC turned off + administrator required
You mean the UAC is disabled for the System or for your process (through linker option).
If the UAC is disabled, Administrator logged in will always be granted highest (elevated) privelege. If non-Admin is logged in, you would not be granted any privelege by OS.
Try using LogonUser and then run process in that user's security token.
-
March 18th, 2008, 02:15 PM
#3
Re: UAC turned off + administrator required
I mean when UAC is completely disabled / turned off on the system.
I tried CreateProcessWithLogonW, but that seems to fail. Maybe I should try again...
-
March 18th, 2008, 02:19 PM
#4
Re: UAC turned off + administrator required
Are you logging and creating the process on user who has Admin rights?
There are Group Policy settings that effect UAC on Vista.
-
March 18th, 2008, 02:22 PM
#5
Re: UAC turned off + administrator required
Yes, I had someone try it for me, but I will check it out myself first before moving any further.
-
March 18th, 2008, 02:26 PM
#6
Re: UAC turned off + administrator required
And do let us know the solution. Atleast others would benefit from it.
You know UAC technology is new in market. Google's hit would point to this thread, which will benefit Codeguru.com. Eventually Brad will give more out of prize distribution to monthly winners - which would definitely benefit you someday.
-
March 19th, 2008, 01:03 AM
#7
Re: UAC turned off + administrator required
-
March 19th, 2008, 03:56 AM
#8
Re: UAC turned off + administrator required
Originally Posted by HanneSThEGreaT
thanks HanneSThEGreaT
the links that you provided are very useful!
one Good link i found
http://www.cs.auckland.ac.nz/~pgut00...ista_cost.html
With Regards
Last edited by dingo_kasper; March 19th, 2008 at 03:58 AM.
Reason: tag
-
March 19th, 2008, 12:32 PM
#9
Re: UAC turned off + administrator required
When the user is guest, and you want to start an application, this can be accomplished by using CreateProcessWithLogonW.
However, the reason it was failing on my side was because my administrator (me, I am the only user using the computer) has a blank password. That is not allowed by default in Windows Vista. Therefore, the function returns 1327 which means that a blank password has been used.
I hope this information is useful for others in the future.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|