zvd 0 Posted April 28, 2005 Does anyone have a script or suggestions on how to write one that would search for all empty directories/subdirectories and delete them? Share this post Link to post Share on other sites
Guest checkist Posted April 29, 2005 Well, ultra-ugly, super-inefficient method is.. cmd /c Xcopy [source] [temporary target] /s /a/h delete [source], and rename [temporary target] directory to original [source] Xcopy's '/s' switch recursively copies "Nonempty" subdirectories. It may work. but it's too slow for any practical use. (In short, this is useless) Share this post Link to post Share on other sites
randallc 0 Posted April 30, 2005 Hi,there are various recursive FileSearch" utilities on the forum.At least one of them searches for directories too;FileSearch gafrostWhen you get to $hFile = FileFindFirstFile($szRoot & "*.*") If $hFile >= 0 Then I imagine you could do an "else" (if no files ie empty), delete the current directory, or add name to a file for checking and deleting at the end from the file? -Interested to hear if you get it going!Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Share this post Link to post Share on other sites
Jos 2,165 Posted April 30, 2005 (edited) Here is a script example that can delete files older than and remove empty directories... Edited April 30, 2005 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Share this post Link to post Share on other sites