************************************************************************ * wwAPI :: GetSpecialFolder **************************************** *** Function: *** Assume: 0x002b - Common Files *** 0x0026 - Program Files *** *** *** Pass: *** Return: ************************************************************************ FUNCTION GetSpecialFolder(lnFolder) IF VARTYPE(lnFolder) = "C" DO CASE *** MSDN - CSIDL flag translates CASE lnFolder = "Program Files Common" lnFolder = 0x002B CASE lnFolder = "Program Files" lnFolder = 0x0026 CASE lnFolder = "Documents Common" lnFolder = 0x002E CASE lnFolder = "Documents User" OR lnFolder = "My Documents" lnFolder = 0x0005 CASE lnFolder = "Send To" lnFolder = 0x0009 CASE lnFolder = "My Computer" lnFolder = 0x0011 CASE lnFolder = "Desktop" lnFolder = 0 CASE lnFolder = "Application Data" lnFolder = 0x001A ENDCASE ENDIF DECLARE INTEGER SHGetFolderPath IN Shell32.dll ; INTEGER Hwnd, INTEGER nFolder, INTEGER Token, INTEGER Flags, STRING @cPath lcOutput = repl(CHR(0),256) lnResult = SHGetFolderPath(Application.hWnd,lnFolder,0,0,@lcOutput) IF lnResult = 0 lcOutput = STRTRAN(lcOutput,CHR(0),"") + "\" ELSE lcOutput = "" ENDIF RETURN lcOutput ENDFUNC * wwAPI :: GetSpecialFolderYou can look up other constants on MSDN. One of those allows retrieval of the TEMP folder as well.