Windows 7 Do you want to allow the following program to make changes to this computer?

#1
We are in the process of modifying some applications to run under Windows 7, however, when we run them, we get the ""Do you want to allow the following program to make changes to this computer?" message from UAC.

I know how to turn UAC off to prevent this, but that is dealing with the symptoms rather than the problem. We would like to write our applications properly so that the error message does not appear in the first place.

Can anyone provide a definitive list of program actions which trigger the error message ?

Interestingly, when debugging our VC++ 2008 applications, the error message appears before any of the code actually runs, so evidently, it is not just the code which counts.
 


#2
UAC automatically does that with ALL programs, it's the nature of the beast, so to speak. Regardless of what program it will do that. It has nothing to do with the application you're running.

Just turn off UAC and you won't see it.
 


#3
UAC automatically does that with ALL programs, it's the nature of the beast, so to speak. Regardless of what program it will do that. It has nothing to do with the application you're running.

Just turn off UAC and you won't see it.
Hi Nubiru,

Thankyou for your reply, but unfortunately, we can't just turn UAC off - many of our clients mandate its use so we have to fit with it.
Microsoft manage to not trigger UAC as do many other software products, so evidently it can be done. What we want to know is how do the code for this ?

Regards
 


Veegertx

Extraordinary Member
#4
Won't cure the asking for elevation but it made it less annoying allowing me to do things I needed

Code:
'Verify we working with Win 7. I think Vista fits here also
Str1 = Reg_Read(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion", "ProductName")
If InStr(Str1, "Windows 7") Then
   Str1 = Reg_Read(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers", MyAppPath & "YOURAPP.exe")
 If Str1 <> "# RUNASADMIN" Then
   Reg_Write HKEY_CURRENT_USER, "Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers", MyAppPath & "YOURAPP.exe", "# RUNASADMIN", REG_SZ
   Reg_Write HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers", MyAppPath & "YOURAPP.exe.exe", "# RUNASADMIN", REG_SZ
 End If
End If
Edit: These keys are worth exploring.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\CaretTracking
 


Last edited:
#5
theres a way to setup a scheduled task for automatic elevation without the prompt as suggested here

also theres a list and other info on wiki of tasks that trigger a UAC prompt

If you are making changes using an admin account and your customers all use standard user accounts then UAC can be left on but set to run silently for admin accounts using settings for local security in secpol :)

this may well be relevant Create and Embed an Application Manifest (UAC)
 


Last edited:
This website is not affiliated, owned, or endorsed by Microsoft Corporation. It is a member of the Microsoft Partner Program.