Kevin,
SYS(2023) and your Scripting code return different folders, the first one returns the Foxpro temp folder as it was set in the config file while your code returns the User's Windows Temp folder and they may or may not be the same, in my case they are not.
By the way, in XP the equivalent environment variables are TMP and TEMP, so GetEnv("TMP") => Sys(2023) and GetEnv("TEMP") => Your Scripting code
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?
"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare
"To die for a religion is easier than to live it absolutely"
Jorge L. Borges