Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
5.00/5 (3 votes)
See more:
I am developing a very simple C# Windows Application (it only displays a message box saying "UACtest") that I want it to run at startup without prompting UAC.

For that I created a registry key for it under HKCU, and in the machine that I compiled it (Windows 8 64-bit using Visual Studio 2013) it runs at startup without promping UAC, as expected.

However, if I export the executable to a Windows 7 machine and do exactly the same thing, a UAC prompt is shown at startup.

Please note that the manifest of the executable has "asInvoker" on the "requestedExecutionLevel".

Also when I directly double click the executable, it never prompts UAC neither on Windows 7 32-bit or in the Windows 8 64-bit, the UAC prompting problem is only at startup.

I also tried to compile the executable on the Windows 7 32-bit machine (to maybe bypass some compatibility issues) and a strange thing happened, in that machine now UAC is not prompted at startup as expected, however, when I make the test on another machine (Windows 7 64-bit under Virtual Box) it prompted UAC at startup.

This has now really puzzled me, can someone please tell me a way to compile it so that it never prompts UAC at startup on all versions of Windows?

The project properties I used on Visual Studio 2013 are the default ones, except: *Target framework: 2.0 *Platform target: x86

And the UAC settings on all machines where the default one: "Notify me only when applications try to make changes on my computer (default)"

Also the name of the executable does not contain words like "install" or "update" to not trigger UAC installer heuristics.
Posted
Comments
Bernhard Hiller 10-Apr-14 3:08am    
Is there some problem with the "zone identifier"? I.e. Windows thinks that the program was downloaded from a dangerous place in the internet... Are the computers in the same domain?
Is your executable signed, and if so, is the certificate trusted by all of your test machines?
Richard C Bishop 11-Apr-14 16:00pm    
Post as solution if it solved the OP's problem!
Member 10737826 11-Apr-14 14:33pm    
Thanks a lot!! I posted this question on many forums but you were the only one who pointed me to the right direction.

Yes the problem was the zone identifier, I just downloaded http://jameskovacs.com/2005/04/11/zonestripper-updated/ and deleted it.

Now it startups without prompting UAC :D

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