HockeyFan Posted May 30, 2007 Share Posted May 30, 2007 Can someone help me, please! I need help creating an array that list the folders in a specific directory (according to certain criteria), and then uses the array output to delete those folders. Here is what I came up with, but of course, it doesn't work...doesn't delete the folders. #Include <File.au3> #Include <Array.au3> $FileList=_FileListToArray("C:\Software\", "Proxy*") If @Error=1 Then MsgBox (0,"","No Files\Folders Found.") Exit EndIf $Output = _ArrayDisplay($FileList,"$FileList") DirRemove($Output, 1) Link to comment Share on other sites More sharing options...
GaryFrost Posted May 30, 2007 Share Posted May 30, 2007 Can someone help me, please! I need help creating an array that list the folders in a specific directory (according to certain criteria), and then uses the array output to delete those folders. Here is what I came up with, but of course, it doesn't work...doesn't delete the folders. #Include <File.au3> #Include <Array.au3> $FileList=_FileListToArray("C:\Software\", "Proxy*") If @Error=1 Then MsgBox (0,"","No Files\Folders Found.") Exit EndIf $Output = _ArrayDisplay($FileList,"$FileList") DirRemove($Output, 1) $FileList is the array of Folders $Output is only the return value of 1 or 0 Try looping thru the array and do a DirRemove on each element. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
smashly Posted May 30, 2007 Share Posted May 30, 2007 (edited) Rough example .. #Include <File.au3> #Include <Array.au3> $FileList=_FileListToArray("C:\Software\", "Proxy*", 2) If @Error=1 Then MsgBox (0,"","No Files\Folders Found.") Exit EndIf $Output = _ArrayDisplay($FileList,"$FileList") For $i = 1 To $FileList[0] DirRemove("C:\Software\" & $FileList[$i], 1) Next Cheers Edited May 30, 2007 by smashly Link to comment Share on other sites More sharing options...
HockeyFan Posted May 30, 2007 Author Share Posted May 30, 2007 Smashly, Thanks for the Help! 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