PDA

Click to See Complete Forum and Search --> : Temp files?


|2eM!x
Dec 4th, 2005, 10:31 PM
Can anyone tell me the location of them? I want to make a program that will delete them automatically for me on startup.

dglienna
Dec 5th, 2005, 12:52 AM
I forget where I got this, but it returns the Environment variables.

Option Explicit

Private Sub Form_Load()
Dim ff As Integer
ff = FreeFile
Open App.Path & "\Environment.txt" For Output As #ff
'Set form autoredraw property to true to get this example
'to work
Dim myuser As Variant
Dim I As Integer
'used to test if any environment variables exist
'sometimes they don't
Dim sTemp As String
I = 1
myuser = Environ(I)
sTemp = myuser
Form1.Print " " & Environ(I)
Print #ff, Environ(I)
I = I + 1
'Print all values on form
Do While Len(myuser) > 0
Form1.Print " " & Environ(I)
Print #ff, Environ(I)
I = I + 1
myuser = Environ(I)
sTemp = sTemp & myuser
' Print #ff, myuser
Loop
If Len(sTemp) = 0 Then
Form1.Print _
"No environment variables exist"
Print #ff, "No environment variables exist"
End If
Close #ff
End Sub



You can then find the variables you need concerning the TEMP and TMP folders.

Pc_Madness
Dec 5th, 2005, 01:52 AM
On XP... C:\Documents and Settings\Your Username\Local Settings\Temp\

I think... there might be an Application Data folder or something in there as well :\