Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have recently written a C++ application which does things that I would consider "risky" for Microsoft's standards (like system(), CreateProcess(), etc), and it turns out that it doesn't trigger UAC warnings. I also remember writing silly C# applications which did trigger UACs.

So my question is: What, specifically, triggers UAC warnings? Does it have something to do with the compiler? (I'm using MinGW via DevC++)

share|improve this question
Some more info required, perhaps some sample code? CreateProcess for example would not be risky as long as its not run by an Admin most likely. – AthomSfere May 14 '13 at 17:00
Nothing much, just a bunch of system() and some PSAPI stuff. My point, actually, is to know what could trigger it and not some specific example. – esauvisky May 14 '13 at 17:05
I believe anything that required elevated permissions. So you can run system commands and CreateProcess() all you want for things that don't require elevation, but anything that would trigger UAC would trigger UAC, i.e. if your system command tried to run the "add or remove user accounts" – ernie May 14 '13 at 17:23
It's typically when commands like CreateProcess() tries to modify system settings or make changes to the registry outside of the user hive. If the process essentially tries to "extend beyond it's reach". – Moses May 14 '13 at 17:49
up vote 4 down vote accepted

Short answer: Actions which require Administrator privileges will trigger the UAC.

Wikipedia provides an outline list:

User Account Control - Tasks that trigger a UAC prompt.

  • Running an Application as an Administrator
  • Changes to system-wide settings or to files in %SystemRoot% or %ProgramFiles%
  • Installing and uninstalling applications
  • Installing device drivers
  • Installing ActiveX controls
  • Changing settings for Windows Firewall
  • Changing UAC settings
  • Configuring Windows Update
  • Adding or removing user accounts
  • Changing a user’s account type
  • Configuring Parental Controls
  • Running Task Scheduler
  • Restoring backed-up system files
  • Viewing or changing another user’s folders and files
  • Running Disk Defragmenter
share|improve this answer
Oops, I had forgot to check Wikipedia before. What really solved it was reading that Windows 7 has a "more relaxed" UAC version than Vista, which was the current version when I developed my older C# applications. – esauvisky May 14 '13 at 18:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .