I've written a program that calls the System.IO.Path.GetTempPath()
function. All the documentation I've read (like this one) says that the function should return the first path found from this list:
- The path specified by the TMP environment variable.
- The path specified by the TEMP environment variable.
- The path specified by the USERPROFILE environment variable.
- The Windows directory.
I have defined both the TMP
and TEMP
environment variables to be %USERPROFILE%\AppData\Local\Temp
, but the call to GetTempPath()
always returns my %USERPROFILE%
directory instead of the values I've define for TMP
and TEMP
. How can I get the function to return the temporary directory I've defined?