As far as I know de standard folder for Users (usually C:\Users) can be changed (e.g. C:\xzy\Users).
Is it possible to get the Users directory?
Or is there a method to get the path to the DefaultUser Directory?
I have to handle this in .NET Framework 3.5
EDIT: The other Problem is, when the application is running as a service user (e.g. System) the %userprofile% will be located somewhere in C:\Windows
I was doing something else when I saw something that reminded me of this question.
The data you’re looking for lives in the registry.
Read it like this:
Your app will need sufficient privileges to read the registry.