Use PowerShell to find blank folders in Windows 10

The can help you find empty folders in Windows 10 very easily. Only few command lines are needed.

If you like tidy spaces, delete junk often and hate empty junk folders, then you can use Windows 10's built-in utility PowerShell, to find empty folders very easily. And from there it is up to you to delete these empty folders or not.

You can run a simple PowerShell command and list all the empty folders it finds in specific locations that you have specified. In this command you can set the search to be performed on an entire drive or a specific folder. Let's see how.

Step 1: Open PowerShell and run the following command.

$ SomePath = "C: \ Configuration \ dimitris"

Step 2: Then run the following command

Get-ChildItem -Path $ SomePath -Recurse -Directory | ForEach-Object -Process {if ($ false -eq $ _. GetFileSystemInfos ()) {$ _. FullName}}

You are most likely to have zero results because you simply need to first edit the first command of step 1, the above instructions, to suit your needs. Just replace the path that is within the quotes with the path of the folder you want to scan. It may be the entire C disk, so the command will be:

$ SomePath = "C: \"

or if you want to scan a user's folder, the command will be:

$ SomePath = "C: \ Users \ UserName"

The command will return a list of all empty folders to the specified location. The list will include the full path to the folder. It will not delete or move anything. If you want to get rid of one of the folders, you can do so through PowerShell, but it is easier to delete them from .

If you run this command on an entire drive, it may take longer to complete and see the results, especially if you run it on the Windows drive, however, it still scans quickly and is much better than using a classic or even a well-made counterpart U.

It's worth noting that you do not need administrator privileges to run this command, however, if you run it on the Windows drive, you have to run it with administrator rights, otherwise you will not be able to scan certain folders that are protected by the system.

It is likely that even with administrator privileges, the command can not scan specific Windows folders. In this case, it is best to leave these folders in place and not to hurt them. They may be empty, but their operating system has created them and may need to use them for something. If you delete the folders and later forget that you've done it, you may end up in trouble and not understand what's going on.

iGuRu.gr The Best Technology Site in Greecefgns

every publication, directly to your inbox

Join the 2.087 registrants.

Written by Dimitris

Dimitris hates on Mondays .....

Leave a reply

Your email address is not published. Required fields are mentioned with *

Your message will not be published if:
1. Contains insulting, defamatory, racist, offensive or inappropriate comments.
2. Causes harm to minors.
3. It interferes with the privacy and individual and social rights of other users.
4. Advertises products or services or websites.
5. Contains personal information (address, phone, etc.).