Trovare la Directory Temp

Inserire in un modulo Bas:

Private Declare Function GetTempPath Lib "Kernel32.dll" Alias "GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long

Public Function WinTemp() As String
    WinTemp = String$(256, 0)
    WinTemp = Left$(WinTemp, GetTempPath(255, WinTemp))
End Function

Inserire in un Form un CommandButton ed il seguente codice:

Private Sub Command1_Click()
    MsgBox "La directory Temporanea di Windows è : " & WinTemp
End Sub

Testato su: Windows 98, Windows Me, Windows 2000 Professional