tonprofde_math Posted June 21, 2005 Share Posted June 21, 2005 (edited) hi how all delete in temp (folders and files) Edited June 21, 2005 by tonprofde_math Link to comment Share on other sites More sharing options...
eJan Posted June 21, 2005 Share Posted June 21, 2005 This function can be found in: AutoIt v3.0.102$Dir = @TempDir _DirRemoveContents($Dir) 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now