Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi,
My c# .net application can not write to registry or create a new file on some of user systems . Most of users has no problem but some of them who have "administrator" account type (should not have problem with privileges) , has this problem . When they activate "Windows Local Administrator" account (by control panel) and install my application in "Windows Local Administrator" account , their problem is solved . How it is possible to solve their problem , without forcing them to activate their "Local Windows Administrator" account .
Thank you in advance for your help .

What I have tried:

I've googled this problem but no results . The only solution is to activate "Windows Local Administrator" account and install software in that account.
Posted
Updated 24-Jan-17 23:08pm

1 solution

The simple solution is: don't use the registry, and change where you store your data.
Access to the registry is restricted, and becoming more so - mostly because it was used inappropriately in the past for storing everything, and that made it both big and slow, and susceptible to damage from badly written applications. You can expect this problem to get worse, not better - so it is not recommended that new apps use the registry at all.

File access is also restricted to many folder, and that access is also getting more restricted, this time to reduce the effect of virus and ransomware attacks. Again, do not expect access to get simpler! If your app is using a folder which does not have the correct permissions for the user your app runs under, then it needs local admin access in order to do anything - and that's dangerous. One very common mistake is to try and store data in the application folder - which is write protected in production for security but accessible in development.

I'd change app to use local config files, and "safe" folders. This may help: Where should I store my data?[^]
 
Share this answer
 

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