Answer the question
In order to leave comments, you need to log in
How to set permissions on the Users folder?
Windows has a C:\Users folder, with user profiles (desktop, documents, etc.). For example, C:\Users\Ivan.
I need to get the size of this folder. How to get folder size in C# I know.
But I can't do it, because I don't have access to this folder.
By default, there is no access to someone else's folder, even the administrator (you can check - the size of such a folder is 0 bytes). You need to log in with local administrator rights, click on the folder and confirm access (dialog that this action requires administrator rights - ok). And then we will get access to the folder, see its size, etc., and the admin account with full access rights to the folder will appear in the security tab.
How to set permissions on the Users folder from C#?
I log in from under the local administrator i.e. I can do it by hand.
PS
Google. The code from the Internet was compiled, but causes security errors when executed.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question