Results 1 to 2 of 2

Thread: Finding Temp Files

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276

    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:
    1. ' IN MODULE
    2. Declare Function FindFirstFile Lib "kernel32" Alias "FindFirstFileA" (ByVal lpFileName As String, lpFindFileData As WIN32_FIND_DATA) As Long
    3.  
    4. Public Const MAX_PATH = 260
    5.  
    6. Type FILETIME
    7.     dwLowDateTime As Long
    8.     dwHighDateTime As Long
    9. End Type
    10.  
    11. Type WIN32_FIND_DATA
    12.     dwFileAttributes As Long
    13.     ftCreationTime As FILETIME
    14.     ftLastAccessTime As FILETIME
    15.     ftLastWriteTime As FILETIME
    16.     nFileSizeHigh As Long
    17.     nFileSizeLow As Long
    18.     dwReserved0 As Long
    19.     dwReserved1 As Long
    20.     cFileName As String * MAX_PATH
    21.     cAlternate As String * 14
    22. End Type
    23.  
    24. Public Const FILE_ATTRIBUTE_ARCHIVE = &H20
    25. Public Const FILE_ATTRIBUTE_COMPRESSED = &H800
    26. Public Const FILE_ATTRIBUTE_DEVICE = &H40
    27. Public Const FILE_ATTRIBUTE_DIRECTORY = &H10
    28. Public Const FILE_ATTRIBUTE_ENCRYPTED = &H4000
    29. Public Const FILE_ATTRIBUTE_HIDDEN = &H2
    30. Public Const FILE_ATTRIBUTE_NORMAL = &H80
    31. Public Const FILE_ATTRIBUTE_NOT_CONTENT_INDEXED = &H2000
    32. Public Const FILE_ATTRIBUTE_OFFLINE = &H1000
    33. Public Const FILE_ATTRIBUTE_READONLY = &H1
    34. Public Const FILE_ATTRIBUTE_REPARSE_POINT = &H400
    35. Public Const FILE_ATTRIBUTE_SPARSE_FILE = &H200
    36. Public Const FILE_ATTRIBUTE_SYSTEM = &H4
    37. Public Const FILE_ATTRIBUTE_TEMPORARY = &H100
    38.  
    39. ' FORM
    40. Dim FileData As WIN32_FIND_DATA
    41.    
    42. FindFirstFile "C:\temp\~DF2D2F.tmp", FileData
    43.    
    44. MsgBox Hex(FileData.dwFileAttributes)
    The only attribute that is set is archive.
    How do you find temporary files and directories?

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    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
  •  



Click Here to Expand Forum to Full Width