Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

System Temp Folder 2

Status
Not open for further replies.

levinll

Programmer
Oct 29, 2001
65
0
0
US
Is there some API call to find out the location of a computers Temp folder ?
 
Public Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long

Use as follows:

Dim sDir As String
Dim lBuf As Long
Dim lReturn As Long

lBuf = 100
sDir = Space$(lBuf)
lReturn = GetTempPath(lBuf, sDir)
If lReturn = 0 Then
sDir = App.Path
Else
sDir = Left$(sDir, lReturn)
End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top