How to Delete empty folder Windows 10, PowerShell, Command Line [Steps]

Tips to Delete empty folder Windows 10:

In this article, we are going to discuss on How to Delete empty folder Windows 10, Delete empty folders Windows 10 powershell, Delete empty folders Windows 10 command line in Windows 10. You will be guided with easy ways to do so. Let’s starts the discussion.

‘Remove/Delete empty folder Windows 10’:

Whenever you uninstall an application in your Windows 10 computer, you will be left with empty folders in the installation folder in Windows computer. Presence of empty folders in computer can be very disturbing as it often confuses you while navigating. Also, empty folders can be risky for security purposes because malware programs can use empty folders in computer to trigger malware inside it and can cause high CPU/GPU or Disk usage issue, and/or other issues in computer.

However, it is not an easy tasks to find and delete all empty folders one-by-one in computer because it would take forever to find all of them. If you are looking for ways to Delete empty folder in your Windows 10 computer, then you are in right-place for this. Here, you are provided some easy tricks to perform this operation.

Is it safe to delete empty folders in Windows 10?

Yes, deleting empty folders in Windows 10 computer is perfectly safe but you need to be mindful of their file/folder location. If you are unable to delete certain files/folders, it is probably best way is to leave them and even if they are empty. Let’s take a look at steps to do so.

How to Delete empty folder Windows 10?

Method 1: Search for empty folders

Step 1: Open ‘This PC’ in Windows PC and click ‘Search’ tab to open ‘Search’ menu

Step 2: Set the size filter to ‘Empty’, and be sure that ‘All Subfolder’ feature is checked

Step 3: After the search ends, it will display all files and folders that you don’t take up any memory space. Select the ones you want to delete, right-click on it and select ‘Delete’ to delete it.

Method 2: Delete empty folders Windows 10 command line

Step 1: Type ‘cmd’ in Windows Search Box and press ‘SHIFT + ENTER’ keys on keyboard to open ‘Command prompt as Administrator’

Step 2: Type the following command and hit ‘Enter’ key to execute

DIR /AD/B/S | SORT /R > EMPTIES.BAT

Step 3: The ‘EMPTIES.BAT’ files contains a list with all your folders in reverse order. Open the file with WORD or any other editor. Using ‘Find and replace’ feature, search ‘^P’ and replace it with ‘^pRD’ and save the file, and close it.

Step 4: Now, run the file, and it will try to delete all the folders that are on that list, but it will fail for the folders with content.

Method 3: Make sure you have all necessary permissions

If you are unable to delete certain folders in Windows computer, chances required permissions not given to folder in computer. You can provide required permission like administrator permission in order perform Delete empty folder operation.

Method 4: Delete empty folders Windows 10 powershell

Step 1: Navigate to the folder in Windows System where you which to clear the empty folders

Step 2: Press ‘SHIFT’ key here, and click ‘Open PowerShell Window Here’ to open Windows PowerShell tool in current folder

Step 3: Type the following command and hit ‘Enter’ key to execute

(gci “pathaddress” -r | ? {$_.PSIsContainer -eq $True}) | ?{$_.GetFileSystemInfos().Count -eq 0} | remove-item

Step 3: Remove the “pathaddress” and replace it with the path to your current directory. For example, (gci “C:\Users\Abc\Documents\” -r | ? {$_.PSIsContainer -eq $True}) | ?{$_.GetFileSystemInfos().Count -eq 0} | remove-item

Step 4: Once executed, all empty folders in specific path will be deleted including empty subfolders.

Method 5: Delete empty folder Windows 10 using RoboCopy Tool

RoboCopy tool can help you to delete all empty folders present in particular folder in computer.

Step 1: Open ‘Command Prompt’ app, and type the following command and hit ‘Enter’ key to execute

robocop “d:\automobile rates\cars” “d:\automobile rates\cars” /S /move

Step 2: Replace the source path and the destination path with the same address of your directory where you wish to delete all the empty folders. For example, robocopy “C:\Users\Abc\Documents” “C:\Users\Abc\Documents” /S /move

Step 3: You should make sure use of trailing backslash at end of folder path and once executed, this will delete all empty folders and subfolders present inside the folder.

Fix Windows PC issues with ‘PC Repair Tool’:

‘PC Repair Tool’ is easy & quick way to find and fix BSOD errors, DLL errors, EXE errors, problems with programs/applications, malware or viruses infections in computer, system files or registry issues, and other system issues with just few clicks.

Conclusion

I am sure this post helped you on How to Delete empty folder Windows 10, Delete empty folders Windows 10 powershell, Delete empty folders Windows 10 command line in Windows 10. You can read & follow our instructions to do so. That’s all. For any suggestions or queries, please write on comment box below.