I need to access current user temp folder ,
like : C:\Users\asad\AppData\Local\Temp
from a WCF service which is hosted as Windows Service on a local machine.
The Windows service is running with ServiceAccount.LocalSystem
because of which System.IO.Path.GetTempPath()
returns C:\Windows
and
Environment.GetEnvironmentVariable("TEMP", EnvironmentVariableTarget.User)
gives C:\\WINDOWS\\system32\\config\\systemprofile\\AppData\\Local\\Temp
.
But what I require is C:\Users\asad\AppData\Local\Temp
. Any help on how to get the mentioned temp path is appreciated.
Thanks