>If all else failed, did you try GETENV() ?
>
The user Temp folder is the Windows Temp folder for all intents and purposes, although the content of the system process' TEMP environment variable may be different than the TEMP variable in the current user context. You can always fall back on the GetTempPath() API call:
DECLARE INTEGER GetTempPath IN Kernel32.DLL ;
INTEGER nBufferLength, ;
STRING @ lpBuffer
cBuffer = REPL(CHR(0), 1024)
nNumTCHAR = GetTempPath(1023,@cBuffer)
? 'Temporary Path is: ' + LEFT(cBuffer, nNumTCHAR)
If nNumTCHAR is 0, an error occurred and you need to call GetLastError() to get the error code. If nNumTCHAR > nBufferLength, this represents the length of the buffer required to hold the path, and the content of cBuffer is inconsistant.
You can also use the SHGetFolderPath(), SHGetSpecialFolderPath(), SHGetFolderLocation(), SHGetSpecialFolderLocation() and SHGetFolderPathAndSubDir() API calls to ret of a number of paths identified by CSIDLs, a special enumeration of common folder locations that is unfortunately Windows version specific as to exactly which CSIDLs are supported, and whether or not a given function is supported for a given Windows version revision. You'll need the MSDN Library (Platform SDK reference), and you'll need to retrieve the SHELL32.DLL version to know which calls are available. Sorry, but a comprehensive reference to these would take a lot more than a single message to cover adequately. There are a couple of these calls documented in the Win32 API section here on UT.
>
>>I will get in before Ed here.
>>>
>>>oWSH=CreateObject("scripting.filesystemobject")
>>>oTempFolder=oWSH.GetSpecialFolder(2) && TempFolder
>>>?oTempFolder.Path
>>>
>>>
>>>>How can i get the windows default temp dirlike c:\windows\temp or c:\winnt\temp.
>>>>I looked in WSH (dino Esposito) but find only folders like Mydocuments but not temp.
>>>>Any help (Ed Rauh where are you)would be appriciated
>>>>
>>>>
>>>>Peter
>>
>>That gives you the current user temp dir but not the system temp dir (more important for me). Got any ideas?