Questions tagged [uac]

This tag is used for questions concerning the User Account Control (UAC) security feature of Windows Vista, Windows 7, 8 and higher versions of Windows.

This tag is used for questions concerning the User Account Control (UAC) security feature of Windows Vista, Windows 7, 8 and higher. This feature, enabled by default, reduces the privilege level of an Administrator account to those of Limited User account. Because of this, many programs that worked in previous Windows versions do not work as expected in Windows Vista, Windows 7, 8 and higher.

With UAC, each user having admin rights would have split-token - one for regular usage and one for administrative usage. Regular token won't be able to have administrative permissions (such as changing system-time, or installing applications). Administrative token would have rights to do any administrative activity.

A process (and all its threads) would have either of these tokens, and they cannot change to another token (for e.g. from Regular to Admin). User has to respond to UAC prompt when opening Admin mode (elevated) application.

Programmers can specify if their programs to require admin (elevated) token so that OS will always attempt to launch the process with elevation. This information is put into EXE header itself.

1432 questions
28
votes
3 answers

UAC need for console application

I have a console application that require to use some code that need administrator level. I have read that I need to add a Manifest file myprogram.exe.manifest that look like that :
Patrick Desjardins
  • 136,852
  • 88
  • 292
  • 341
28
votes
4 answers

Is it possible to make a shortcut to a relative path in Windows that runs as admin?

To create a shortcut with a relative path, set the target to the following. %windir%\system32\cmd.exe /c start your_relpath\app.exe [your_args] It is also straightforward to make the program run as administrator. Properties > Advanced > Run as…
Trevor Merrifield
  • 4,541
  • 2
  • 21
  • 24
27
votes
1 answer

How do I avoid UAC when my EXE file name contains the word "update"?

I noticed the following phenomenon: An executable built with Delphi 7 and part of the name including "Update" (e.g. "UpdateMyApp.exe") causes UAC to step in to display a warning like "do you want to allow the program to make changes to your…
Christian
  • 703
  • 7
  • 15
27
votes
6 answers

Request Windows Vista UAC elevation if path is protected?

For my C# app, I don't want to always prompt for elevation on application start, but if they choose an output path that is UAC protected then I need to request elevation. So, how do I check if a path is UAC protected and then how do I request…
sieben
  • 2,161
  • 4
  • 23
  • 31
26
votes
3 answers

Mark MSI so it has to be run as elevated Administrator account

I have a CustomAction as part of an MSI. It MUST run as a domain account that is also a member of the local Administrators account. It can't use the NoImpersonate flag to run the custom action as NT Authority\System as it will not then get access to…
Ryan
  • 23,871
  • 24
  • 86
  • 132
26
votes
1 answer

Windows 7 and Vista UAC - Programmatically requesting elevation in C#

I have a program that only requires elevation to Admin on very rare occasions so I do not want to set-up my manifest to require permanent elevation. How can I Programmatically request elevation only when I need it? I am using C#
Chris
  • 26,744
  • 48
  • 193
  • 345
26
votes
1 answer

How to run application which requires admin rights from one that doesn't have them

I've been stuck on this for a few hours until I've finally managed to do it. There are already links which pointed me the right direction: Is it possible for the executable to ask for Administrator rights? (Windows 7) CreateProcess error=740, The…
Samuel
  • 2,430
  • 5
  • 31
  • 41
25
votes
1 answer

Windows Vista/Windows 7 privilege: SeDebugPrivilege & OpenProcess

Everything I've been able to find about escalating to the appropriate privileges for my needs has agreed with my current methods, but the problem exists. I'm hoping maybe someone has some Windows Vista/Windows 7 internals experience that might shine…
KevenK
  • 2,975
  • 3
  • 26
  • 33
25
votes
4 answers

Detecting registry virtualization

I have a set of C# (v2) apps and I am struggling with registry virtualization in Win7 (and to a lesser extent Vista). I have a shared registry configuration area that my applications need to access in HKLM\Software\Company... Prior to Vista,…
robert dumpke
23
votes
3 answers

Elevating privileges doesn't work with UseShellExecute=false

I want to start a child process (indeed the same, console app) with elevated privileges but with hidden window. I do next: var info = new ProcessStartInfo(Assembly.GetEntryAssembly().Location) { UseShellExecute = true, // ! Verb = "runas",…
abatishchev
  • 98,240
  • 88
  • 296
  • 433
22
votes
6 answers

Starting another process with elevation using different user credentials

I'm trying to start an elevated process from with a non-elevated process, but I also need to supply the username and password for a user with administrative credentials. I've tried both the "runas" method for elevation as well as using a manifest,…
Adam Robinson
  • 182,639
  • 35
  • 285
  • 343
22
votes
8 answers

How to detect whether Vista UAC is enabled?

I need my application to behave differently depending on whether Vista UAC is enabled or not. How can my application detect the state of UAC on the user's computer?
Andrei Belogortseff
  • 1,861
  • 3
  • 18
  • 26
22
votes
1 answer

Reasons for getting the Program Compatibility Assistant dialog?

What are possible reasons for getting the Program Compatibility Assistant dialog after my application closes? (source: microsoft.com) EDIT: Program Compatibility Assistant: frequently asked questions I realize this question has already been asked…
JohnB
  • 18,046
  • 16
  • 98
  • 110
22
votes
2 answers

Detect if program is running with full administrator rights

I need to determine if my program is running with full administrator rights. By that I mean if uac is turned on (for win vista/7) that I need to determine if the program actually has admin rights (like if the user right clicked and selected "run as…
David Chen
  • 301
  • 1
  • 3
  • 4
22
votes
4 answers

How does Windows decide whether to display the UAC prompt?

In my VB6 application I open other EXE files. My application runs without any UAC prompt, but I have an EXE which checks for updates to software. This prompts the UAC prompt. So how does Windows decide whether to show the UAC prompt? I saw this link…
IT researcher
  • 3,274
  • 17
  • 79
  • 143
1 2
3
95 96