erik7426 Posted March 3, 2009 Share Posted March 3, 2009 Is it possible to use FileDelete and/or DirRemove AND have the files/folders that are deleted by these commands written to a log file. So, if I have DirRemove(@TempDir, 1) I want to be able to capture all the files that were deleted and save it to a log. Any help would be greatly appreciated... Link to comment Share on other sites More sharing options...
weaponx Posted March 3, 2009 Share Posted March 3, 2009 _FileListToArray + FileDelete + _FileWriteLog Link to comment Share on other sites More sharing options...
erik7426 Posted March 3, 2009 Author Share Posted March 3, 2009 (edited) _FileListToArray + FileDelete + _FileWriteLog_FileListToArray + FileDelete are no problem.Can you give me an example of how I would use _FIleWriteLog in conjuction with those commands?I know this can be done in DOS, just trying to make it work in AutoIt... Edited March 3, 2009 by erik7426 Link to comment Share on other sites More sharing options...
Robjong Posted March 3, 2009 Share Posted March 3, 2009 (edited) _FileListToArray + FileDelete are no problem. Then I guess you can get this to work ; .... $aArray is the file list .... For $i = 1 To UBound($aArray) - 1 If FileDelete($aArray[$i]) Then _FileWriteLog("mylog.txt", 'Deleted file: "' & $aArray[$i] & '"') Else _FileWriteLog("mylog.txt", 'Unable to delete file: "' & $aArray[$i] & '"') EndIf Next Edit: Loop Edited March 3, 2009 by Robjong Link to comment Share on other sites More sharing options...
weaponx Posted March 3, 2009 Share Posted March 3, 2009 Theoretically you would want to use a recursive file search function to handle sub folders. 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