Click here to Skip to main content
15,035,283 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
In an ASP.NET 2.0 Application, an ActiveX control is used. When user first time access the appliction and he/she did not have that ActiveX registered. Application show a popup to install ActiveX. When user follow the process, ActiveX is registered and application loads the ActiveX to accomplish desired tasks.

In Windows Vista, Win 7 and Win 8, User Access Control (UAC) is prompted to allow to install the ActiveX at very first time. This happens even if user is Administrator too.

What are alternatives to override this UAC component while installing ActiveX ?
Suggestions are appreciated.

The only solution is to turn UAC off, there's nothing you can do in code to get around this.

UAC exists to protect the user from the code. For that reason the code can't bypass the user. If there was a way around this in code, then viruses or malware could bypass UAC without telling the user, therefore making UAC useless.
Exactly, a 5.
I am amazed by the logic of some. One of the typical question is: "Error message says: 'You cannot do A'; my question: how to do A?". :-)
Ron Beyer 23-Jul-13 1:40am
Logic has no place in beginner programming :)
The bigger problem is: I faced with such "beginners" with 20+ years of "experience". They already seized to understand that they are still beginners with negative value (their value was about zero when they were younger). This is really sad...
And you know what? I hope your (hopefully humorous) note on beginners is not true. I knew many people who were quite reasonable from the very first steps in programming. Sometimes I think that only they have done something valuable.
Being a real beginner (the one who really begins) is a noble position, many never reach this status...
Ron Beyer 23-Jul-13 1:52am
Yes, very much on the humorous side. I've also known many a "beginner" programmer that had a better sense of logic than some veteran "programmers". A good programmer is always a beginner in some respect as they are always attempting to learn and expand, so indeed a beginner is a noble position and a lifelong one for those skilled in the art :)
That's a good point, too. Do you know that in science people are never called "professional"? it would sound ridiculous. You can be a professional plumber, but a physicist or mathematician is supposed to be an "amateur" :-)
Itz.Irshad 23-Jul-13 2:07am
@Ron Beyer: Thanks for information. I think same as you people because if we are looking for to bypass UAC then UAC is purposeless. But, what if user still interested to get rid of UAC.
Well, there are many cases when user have no admin privileges but still they need to run the application. That's the reason behind this question.

Anyway, Thanks.
Ron Beyer 23-Jul-13 2:11am
If they need to run the application and don't have admin privileges then they need to talk to their admin about running the app. UAC can be disabled and there are tons of tutorials on the web about how to do it, but its not something you can do in code. Again it boils down to protecting the user, your code may be legit, but what about the thousands of websites that have ActiveX that are malicious? If the user doesn't have admin privs then there's a reason that they don't have them, aka they don't own the computer or the network.

I've just added Solution 3 to show the alternatives. The user can lower down UAC protection in the whole system (not recommended), and a developer can create and embed an application manifest to request elevated permissions in the very beginning... Please see.

In addition to discussion in comments to Solution 1:

You user is always free to lower down UAC protection. For example, on Windows 7:
Control Panel -> Small Icons (All Control Panel Items) -> Action Center -> Change User Account Control Settings.

If your customer lowers the slider down to "Never Notify", she/he won't have UAC messages at all. It's important that they make this questionable decision by themselves and that you won't do it on your computer. :-)

And of course, your application cannot lower down UAC, otherwise it would defeat the purpose of the whole idea of UAC.

You can do different thing. You may know that your application would always need elevation of privileges. In this case, you may want to request elevation of the privileges in the very beginning, without having the user to use "Run as Administrator" or using equivalent *.LNK. This is done by claiming requested permissions accordingly in the embedded application manifest. Such manifest is created and embeded very easily. Please see:[^].

Ron Beyer 23-Jul-13 10:34am
+5, good points.
Sergey Alexandrovich Kryukov 23-Jul-13 11:04am
Thank you, Ron.
There is no way to bypass UAC. But you can register your control at User-Level which will no required Administrator Privileges. Window Vista or later with IE8 introduce the new mechanism to register ActiveX control at Current-User with non-admin rights. You only have to update your INF file and then repackaging your control.

Please check the following link for more detail.[^]

Please Note that this answer is valid if you have In-Proc ActiveX control.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900