How to retrieve the path of the Windows temporary folder -------------------------------------------------------- When you want to create and use a temporary file,it's very convinient to just create it in the current folder,and erase it when you're done.This is not however the *right* way to do it,since Windows has a standard folder for storing temporary files,it's usually C:\Windows\Temp\ but you can't hard code this string in your program,it's just an assunption. The safest way to go about it,is to use the GetTempPath API. You can use this little wraper function (GetWindowsTempPath) that I wrote,since GetTempPath is a somewhat bitchy API. Option Explicit Private Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long Private Sub Form_Load() MsgBox "The path of your system's temp folder is: " & vbcrlf & GetWindowsTempPath Unload Me End Sub Public Function GetWindowsTempPath() As String Dim TempPathLen As Long GetWindowsTempPath = String(500, " ") Call GetTempPath(500, GetWindowsTempPath) GetWindowsTempPath = RTrim(GetWindowsTempPath) End Function Create a new project and paste the above code in the code module of Form1. All it does is display a string containing the path of the Windows temporary folder of your system.