Programmatic access to UAC. Kinda.

by Matt 5. June 2007 05:28

I kinda like this web site. It offers a C++ source file with various functions to help in install time situations; functions like IsVista() and IsWow64(). And it also gives some functions to deal with User Account Control. GetElevationType(), IsElevated() and RunElevated() are going to be very useful.

The killer function, though is RunNonElevated(). This is a doozy.

Picture this - I run my installer. It needs to write to C:\Program Files, so gets elevated. Trying to be as nice as I can to my user, I offer them a chance to run my program at the end of the installer, as is common. Unfortunately, since the installer is now running elevated, my newly installed program will run elevated, which is not what I want.

So this function could be very useful. The downside is that Microsoft haven't actually provided any means of running a program non-elevated, so this function has to hack around it by injecting itself into the shell, which it knows is not elevated and getting explorer to spawn the process.

Is it just mean that sees the irony in having to inject code into one process to run another process securely?



Comments (9) -

suv reviews
suv reviews
7/20/2011 10:22:13 PM #

Is it ok if I quote your article in my monthly newsletter? I would think this article suits my topic perfectly. Well ya, thanks for posting this article.


best hybrid cars 2011
best hybrid cars 2011
7/22/2011 4:52:37 AM #

I wonder if he cheated on her? I remember he cheated on his previous wife with JLO so it wouldn’t be surprising.


ipad features
ipad features
7/24/2011 5:10:28 AM #

Hi,what an excellent article this is,I found it on bing and I like it very much,I agree with what you have said, lots of things will be learned form your site,but I still have some questions with the last part,can you explain it for me ?I will appreciate your answer,and I will be back again!


getting study your write-up, I believe the details created are quite strong and interesting and need to agree within the most part along with your thoughts. <a href=\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\">melbourne cup live stream tips</a>


Mitzi Towers
Mitzi Towers United States
1/6/2016 2:10:05 PM #

Congrats! This is such a great website, I know it will translate well into book form. Which is AWESOME!


Brandon Penhallurick
Brandon Penhallurick United States
1/15/2016 8:55:37 AM #

Congrats! This is such a great website, I know it will translate well into book form. Which is AWESOME!


James Fly
James Fly United States
7/30/2016 3:52:29 AM #

This is such a great site come check out our new free Dating web site would wide fined your true love at


Alicia Amarillas
Alicia Amarillas United States
8/25/2016 4:03:19 AM #

Nice informative blog. Hopefully you can also discuss some green home designs with nice architectural layouts


Ayako Newville
Ayako Newville United States
7/13/2017 5:32:49 AM #

Get an in-depth look at Logic Pro X. Dive deep into a vast array of tools for composing, recording, editing, mixing, and more.


Add comment

  • Comment
  • Preview


Month List


Comment RSS