How to Remove Empty Directories

Filed under: PC Maintenance 

System maintenance is probably not anybody’s favorite thing to do. But if you want a fast and error free computer, regular PC maintenance is required. Clean up your registry, scan for viruses and spyware, and run a defrag program on a regular basis.

Disk performance particularly is very critical in Windows performance. Temp files, junk files, installation files, cookies, restore points… they all take up space and cause disk fragmentation.

Using the proper tools for system maintenance is half the work. Although the Windows disk cleanup process has been improved in various versions of Windows, there are still cleanup aspects that are not covered.

If you ever looked at a disk map in a defrag program, you might have noticed that the directories, or folders, take up a significant amount of disk space as well. Not only that, but more folders have an impact on the Master File Table (MFT) on NFTS disks. And reducing the number of folders on a disk can help with disk performance.

How to Reduce the Number of Folders on a Disk

The simplest way to reduce the number of directories on a disk is to remove all empty folders. Empty folders are mostly the result of temporary storage requirements, like install, update and upgrade processes. Some are removed by the Windows disk cleanup process, but many are not.

The tool we suggest for removing empty directories is called RED (short for Remove Empty Directories). Remember to always make a backup before you run a new maintenance program, so you can restore any missing file, or in this case, any missing folder.

Download the installer called “red-v2.1-setup.exe“ from the RED website, and execute the installation file once the download completes. The setup wizard is a standard installation process, with the exception of accepting the GNU Public license. The program only takes up 222KB, which is very small compared to many applications.

Once you start the program, select the Settings tab to configure the application.

RED settings

The RED program settings allow you to specify folders that should be ignored. This allows you to exclude (empty) folders that are needed by some programs. Keeping the system folders is also a good idea, so leave that checkmark selected.

We do suggest to clear the checkmark for the option Folders with files that are all 0kb, which count as empty. The reason for that is that many applications use zero byte files as part of the program logic, which means they are often in use. As such, they can not be deleted and the program will signal that. The desktop.ini file is one such file.

Scanning only took a minute on our test system (T5250 based laptop with 70 GB partition, of which 30 GB was free). The disk is a WD1600BEVS-22RST0.

After initial processing, the screen shows a tree view with the directory structure of the disk. All empty folders are colored red, indicating they will be removed by the program.

RED scan result

The folder removal process takes a bit longer than the initial scan for empty folders, but still only took 2 minutes on our test system.

It is possible that directories that are empty can actually not be removed. A possible reason for this is that a running program is preventing this. If you can identify the program, you can try terminating it and then try the delete folders again.

Once the application completes, try and run your most popular applications to make sure they all work as they should. A reboot is also a good idea to ensure everything works as before.

To complete the cleanup process, run a defrag program. Windows defrag can be used, but commercial applications like Diskeeper and PerfectDisk support boot time defrag, which will also defrag the MFT (Master File Table).


Leave a Reply

You must be logged in to post a comment.