Reputation: 2037
I wrote a service and in the code I tried to get the AppData
folder's path:
C:\Users\[Username]\AppData\
I tried:
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
But I got:
C:\Windows\system32\config\systemprofile\AppData
Upvotes: 0
Views: 1018
Reputation: 9499
You're getting the AppData folder of the Account running the service. (System Account) There is no other user involved in it.
If you want a particular user's AppData folder, run the Windows Service under that user's account.
Upvotes: 1