supportvb Posted October 18, 2016 Posted October 18, 2016 Hello i need to list all folder under a folder and get each path to then check if a name is in the path Here is the code i have #include <file.au3> #include <array.au3> $PathConstats = IniRead(@ScriptDir & "\Clean_Up_Constats_Photos.ini","Path","1","") $ArrayFolders = _FileListToArrayRec($PathConstats,"*",$FLTAR_FOLDERS ,1) now i can show this with this line of code _ArrayDisplay($ArrayFolders, "Sorted tree") But i need to check every path to search for a certain string and then delete the folder and all subfolder and sub files if that sting is found Can someone help me please Thanks !
spudw2k Posted October 18, 2016 Posted October 18, 2016 (edited) Use either a for...next or for...in...next loop to interate through the array indicies For $iX = 1 to UBound($ArrayFolders)-1 ;... Next ;or For $sDir in $ArrayFolders ;... Next Use StringInstr to determine if a string contains a desired substring If StringInstr($ArrayFolders[$iX], "substring") Then ;.... EndIf ;or If StringInstr($sDir, "substring") Then ;.... EndIf Use DirRemove to delete a directory Edited October 18, 2016 by spudw2k Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF
supportvb Posted October 19, 2016 Author Posted October 19, 2016 (edited) Ok Thanks for your help ! It's working Edited October 19, 2016 by supportvb
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