0

I need to get the path of each windows user AppData folder. I tried to use

string path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);

and it gives the path of the current user only.

I need to iterate all windows users and get the AppData path.

I looked for a solution in the web and tried this and this but did not succeed.

I thought to go over all windows users as described here and somehow using the result of the current user AppData path combine to all users path, but I am not quit sure how to implement it.

Community
  • 1
  • 1
eskadi
  • 245
  • 3
  • 17
  • 3
    What do you plan to _do_ with the path? Unless your app is running as a highly-privileged user you are going to have issues _accessing_ those paths. Also of those things you say you have tried, what for example goes wrong with this solution? http://stackoverflow.com/a/23093062/2701753 – tolanj Nov 18 '14 at 13:35
  • To get to the special folders of another user, you're going to need to look in that user's registry hive. This will require getting the list of user profiles (WMI's `Win32_UserProfile` should do that), loading the user's registry hive, and then looking in the right key. – Richard Nov 18 '14 at 13:35
  • Provide the code what you have tried and actual,expected result? It's helpful for us to figure it out. – Chandrasekar Kesavan Nov 18 '14 at 13:57
  • @tolanj for some reason I missed the solution you mentioned. It worked. thanks a lot! – eskadi Nov 19 '14 at 07:33

0 Answers0