Jump to content

all delete in folder


Recommended Posts

  • 3 weeks later...

In my case that will be:

$Dir = @UserProfileDir & "\Local Settings\Temporary Internet Files"
_DirRemoveContents($Dir)

MsgBox(262144, "Complete", "Temporary Internet Files cleaned")

Func _DirRemoveContents($sPath)
    
    Local $sPattern
    Local $sFile
    Local $hFile
    
    If StringRight($sPath, 1) <> "\" Then $sPath = $sPath & "\"
    $sPattern = $sPath & "*.*"
    
    If Not FileExists($sPath) Then Return 0
    
    FileDelete($sPattern)
    
    $hFile = FileFindFirstFile($sPattern)
    If @error Then Return 0
    
    While 1
        $sFile = FileFindNextFile($hFile)
        If @error Then ExitLoop
        
        If $sFile <> "." And $sFile <> ".." Then
            If StringInStr( FileGetAttrib($sPath & $sFile), "D") Then
                DirRemove($sPath & $sFile, 1)
            EndIf
        EndIf
    WEnd
    
    FileClose($hFile)
    Return 1
EndFunc
Where all of my Temporary Internet Files and cookies are stored into "Temporary Internet Files" folder without subfolders (WinXP SP2).
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...