JRL wrote:
jpuziano wrote:This one was so easy...
Then why did it take two days for a response?
I responded when I saw it... I'll have to get back to reading the forums daily.
JRL wrote:
There are several system variables that are directory names:
- WIN_DIR
Windows Directory Path
SYS_DIR
Windows System Directory Path
SYS_NATIVE
Native System Directory Path Bypassing 64 Bit Redirection
TEMP_DIR
Windows Temp Directory Path
DESKTOP_DIR
User's Desktop Path
USERDOCUMENTS_DIR
User's Documents Path
PROGRAM_FILES
Program Files Folder (Will be x86 folder if running on x64)
PROGRAM_FILES_NATIVE
Native Program Files Folder (e.g. "Program Files" not (x86) on x64)
If you want to use any of these as part of a file name, they all need to be surrounded by percents, and all but
TEMP_DIR need to be followed by a backslash.
Yes, this last bit about TEMP_DIR being different has thrown me a few times... so when I use one of the above system variables, I usually write a quick one-liner and run it in the editor to see what the value is... and to see if it includes the trailing backslash or not...
MDL>%TEMP_DIR%
...then code accordingly. Yes I know I could use the Debugger and Watch List but the above is faster/easier.
Of course it would be nice if ALL the above System Variables that are Directory Names included the trailing slash... however since changing that now would break a lot of old code, leaving it alone seems better... I guess it just evolved this way.
I often visit the following Help Topic though...
Current Help File 'System Variables' Topic wrote:System Variables
Environment Specific Values:
OS_VER
Operating System
WIN_DIR
Windows Directory Path
SYS_DIR
Windows System Directory Path
SYS_NATIVE
Native System Directory Path Bypassing 64 Bit Redirection
TEMP_DIR
Windows Temp Directory Path
Since TEMP_DIR is the only one that is different, could we get this help topic
updated... perhaps like the following?
Possible Updated Help File 'System Variables' Topic wrote:System Variables
Environment Specific Values:
OS_VER
Operating System
WIN_DIR
Windows Directory Path
SYS_DIR
Windows System Directory Path
SYS_NATIVE
Native System Directory Path Bypassing 64 Bit Redirection
TEMP_DIR
Windows Temp Directory Path *includes a trailing backslash \
That would be all I'd need to remind me that TEMP_DIR is the special one.
Thanks and take care