zvd Posted April 28, 2005 Share 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? Link to comment Share on other sites More sharing options...
Guest checkist Posted April 29, 2005 Share 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) Link to comment Share on other sites More sharing options...
randallc Posted April 30, 2005 Share 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 Link to comment Share on other sites More sharing options...
Developers Jos Posted April 30, 2005 Developers Share 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. 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