views:

76

answers:

3

When a process is running at the low integrity level, you can't write to %temp% so I need a way to find the path to the %temp%\Low directory (Without hardcoding the word "Low")

A: 

According to MSDN

"Low-integrity processes can write and create subfolders under %USER PROFILE%\AppData\LocalLow"

I don't think there's any way to avoid hardcoding thost last two folders.

bwarner
A: 

ShGetKnownFolderPath

Jethro L
+1  A: 

According to MSDN

When in Protected Mode, extensions can write files to a folder below the user's UserProfile folder, typically %userprofile%\AppData\LocalLow. Use the SHGetKnownFolderPath function with the FOLDERID_LocalAppDataLow flag to obtain the expanded folder name.

SHGetKnownFolderPath(FOLDERID_LocalAppDataLow, 0, 
   NULL, szPath, ARRAYSIZE(szPath));
edosoft
That gets the local appdata but not the temp low...
Larry Osterman