Search the Community
Showing results for tags 'file delete'.
In my programm i need to delete folders/files and show the user about progress. Though it can can easily be done with FileDelete and DirRemove (without progress), the problem comes when the folder/file size is larger.It hanges the main gui completely. I searched the forum and found a script which deletes files one by one. However the script does not work properly. It does not delete all the files and folders. Once the script complete then i have to provide admin rights to delete remaining folder/files. Here is the script i am trying to use:- $DIR = "path\to\folder" If Not @error Then $FILE = _FileListToArray($DIR) If IsArray($FILE) Then Dim $PATH ProgressOn("Removing "& $SEARCH,$DIR) For $INDEX = 1 To $FILE ProgressSet($INDEX*100/$FILE,$FILE[$INDEX]) _PathSplit($DIR & "\" & $FILE[$INDEX],$PATH,$PATH,$PATH,$PATH) If $PATH <> "" Then FileDelete($DIR & "\" & $FILE[$INDEX]) Else DirRemove($DIR & "\" & $FILE[$INDEX],1) EndIf Sleep(250) Next ProgressOff() EndIf EndIf I also need to remove the folder where $DIR points to.