quote:
Originally posted by Underlord
quote:
The Temp folder is located in the directory stated in the environment variable TEMP or TMP. This value of these environment variables can be found in the registry setting:
HKEY_CURRENT_USER\Environment
%tmp% or %temp% works
yep, just as I said (see underlined text)
But the TEMP and TMP variables will only be expanded into their corresponding values (as set in the registry) in a command line environment or when used directly within Window's paths (provided those variables are defined that is; which isn't always so...).
Using the TEMP and TMP environment variables inside a program will not work, it will just be another literal string.
There are ways to expand them in a program of course but it is not recommended to use environment variables in programs at all. Especially variables which point to a directory location (like the TMP and TEMP). To always get the proper path (even if those variables don't exist; which is quite possible) you need to use the SHGetSpecialFolderPath API and the likes instead.