Question

As in the topic - is there any way to get currently logged user appdata environment variable?

In an application there is no problem to do that with SHGetFolderPath() or simply getenv("appdata") but in service these methods doesn't work. It runs as "SYSTEM" account.

I think that should be a way to obtain %appdata% using WMI but I'm not sure about that.

%userprofile% is the second point of interest by I handle it when I will get %appdata%.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top