I have a windows service which is running under "Local system". In "OnStart" method, I logged a event log entry using,
eventLog.WriteEntry($"Path: {Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), @"Pictures")}")
It logged as "Path: C:\WINDOWS\system32\config\systemprofile\Pictures"
But the same thing I tried in a Console App using Console.WriteLine, It logged "Path: C:\Users\john\Pictures"
In the windows service, I need to access the current user directory as I am getting from console app.
Please help me on this.