CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    Nov 2003
    Posts
    2,185

    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!

  2. #2
    Join Date
    Mar 2003
    Location
    India {Mumbai};
    Posts
    3,871

    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.
    My latest article: Explicating the new C++ standard (C++0x)

    Do rate the posts you find useful.

  3. #3
    Join Date
    Nov 2003
    Posts
    2,185

    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...

  4. #4
    Join Date
    Mar 2003
    Location
    India {Mumbai};
    Posts
    3,871

    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.
    My latest article: Explicating the new C++ standard (C++0x)

    Do rate the posts you find useful.

  5. #5
    Join Date
    Nov 2003
    Posts
    2,185

    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.

  6. #6
    Join Date
    Mar 2003
    Location
    India {Mumbai};
    Posts
    3,871

    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.

    My latest article: Explicating the new C++ standard (C++0x)

    Do rate the posts you find useful.

  7. #7
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,283

    Re: UAC turned off + administrator required


  8. #8
    Join Date
    Feb 2007
    Posts
    247

    Re: UAC turned off + administrator required

    Quote 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

  9. #9
    Join Date
    Nov 2003
    Posts
    2,185

    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
  •  





Click Here to Expand Forum to Full Width

Featured