Posted: Mon Jan 20, 2003 2:13 am Post subject: Delete Empty Folders via Command Prompt
Here's a good way to find and delete all those empty folders & subfolders on your system, cleaning up things a bit, via the command prompt.
This goes for Win9x/Me/2k/XP: open up a command prompt window and navigate to the root folder of the drive in question. Enter this command:
DIR /AD/B/S | SORT /R > EMPTIES.BAT
The file EMTPIES.BAT now contains a list of all folders on your HD in reverse order. Use Word or another editor to add the prefix RD (with a space after RD) to every line in the file. In Word, you can do this easily by using Find and Replace to search for ^p (which represents the paragraph mark) and replace it with ^pRD , then hand-correct the first and last lines of the file if necessary. Save the modified EMPTIES.BAT file and exit your editor. Then simply launch the batch file. It will attempt the RD (remove directory) command on each folder, but the command will fail for any folder that isn't empty.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum