|
-
Nov 28th, 2001, 05:56 PM
#1
Thread Starter
Frenzied Member
Finding Temp Files
I am searching for temporary files to delete, but the attributes
of no files are showing up as temporary and I know I have temp
files:
VB Code:
' IN MODULE
Declare Function FindFirstFile Lib "kernel32" Alias "FindFirstFileA" (ByVal lpFileName As String, lpFindFileData As WIN32_FIND_DATA) As Long
Public Const MAX_PATH = 260
Type FILETIME
dwLowDateTime As Long
dwHighDateTime As Long
End Type
Type WIN32_FIND_DATA
dwFileAttributes As Long
ftCreationTime As FILETIME
ftLastAccessTime As FILETIME
ftLastWriteTime As FILETIME
nFileSizeHigh As Long
nFileSizeLow As Long
dwReserved0 As Long
dwReserved1 As Long
cFileName As String * MAX_PATH
cAlternate As String * 14
End Type
Public Const FILE_ATTRIBUTE_ARCHIVE = &H20
Public Const FILE_ATTRIBUTE_COMPRESSED = &H800
Public Const FILE_ATTRIBUTE_DEVICE = &H40
Public Const FILE_ATTRIBUTE_DIRECTORY = &H10
Public Const FILE_ATTRIBUTE_ENCRYPTED = &H4000
Public Const FILE_ATTRIBUTE_HIDDEN = &H2
Public Const FILE_ATTRIBUTE_NORMAL = &H80
Public Const FILE_ATTRIBUTE_NOT_CONTENT_INDEXED = &H2000
Public Const FILE_ATTRIBUTE_OFFLINE = &H1000
Public Const FILE_ATTRIBUTE_READONLY = &H1
Public Const FILE_ATTRIBUTE_REPARSE_POINT = &H400
Public Const FILE_ATTRIBUTE_SPARSE_FILE = &H200
Public Const FILE_ATTRIBUTE_SYSTEM = &H4
Public Const FILE_ATTRIBUTE_TEMPORARY = &H100
' FORM
Dim FileData As WIN32_FIND_DATA
FindFirstFile "C:\temp\~DF2D2F.tmp", FileData
MsgBox Hex(FileData.dwFileAttributes)
The only attribute that is set is archive.
How do you find temporary files and directories?
-
Nov 30th, 2001, 03:13 PM
#2
Why not just do a search for *.tmp, and then whack 'em regardless of what their attributes are?
(Ps. I gotta try and help out somebody that has words from Pink Floyd in their signature!!!!!!!!)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|