Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where can i place common user data other than LOCALMACHINE -Registry without Administrative Rights

In Windows other than the registry -localmachine where can I place common user data that could be accessed by all users.

i need to do this without requesting elevation of admin rights

like image 311
techno Avatar asked Dec 10 '25 00:12

techno


1 Answers

You can store it in the Application data folder. which you can get from Envorinment:

var appDataFolder = Environment.GetFolderPath(Environment.SpecialFolder.CommonDocuments);

To determine if you can access the folder without admin right, run Visual Studio, without admin rights, and see if this code executes successfully.

   class Program
    {
        static void Main(string[] args)
        {
            var folder = Environment.GetFolderPath(Environment.SpecialFolder.CommonDocuments);
            var file = Path.Combine(folder, "testfile.txt");

            File.WriteAllText(file, " Test Settings");
            Console.ReadLine();
        }
    }
like image 179
jvanrhyn Avatar answered Dec 12 '25 13:12

jvanrhyn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!