I have a C# .NET application with about 20 supporting assemblies that I am maintaining.
When it starts, windows shows a UAC dialog that says:
Do you want to allow the following program to make changes to this computer.
If I disable the 'Run as administrator' checkbox on the file's properties dialog, I get a dialog of:
Unable to run [Application Name]. The user account '[Me]' does not have sufficient privileges to write to
C:\ProgramData[Company][Application Name]
This application will try to write to the ProgramData directory which is causing the UAC to ask the user for permission.
How does the UAC know the application is going to write to ProgramData?
What can I change so that the UAC does not complain?
The UAC prompt displays the name of the program that is about to make a system change that requires the approval of an administrator, the publisher of that program and the file origin (if you are trying to run a file).
You can disable UAC through Group Policies. UAC GPO settings are located under Windows Settings -> Security Settings -> Security Options section. The names of the UAC policies start from User Account Control. Open the option “User Account Control: Run all administrators in Admin Approval Mode” and set it to Disable.
Note: Elevating the AnyDesk session will not change the windows session from standard user to administrator. Every UAC action will still require administrator credentials.
How does UAC know the application is going to write to ProgramData
What can I change so that the UAC does not complain?
C:\ProgramData[Company][Product]
C:\ProgramDataAdobePhotoshop
if your application is not seperating these directories, then i'd assume that this is causing your UAC issue. try adding your path seperators. C:\ProgramData\Adobe\Photoshop
[as an example]My recommendation - For any application that needs to story data - use the users Application Data
rather than the ProgramData
folder. You will not get any UAC prompts if you use this directory. (this question could help with that)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With