Get-ChildItem -Path $ SomePath -Recurse -Directory | ForEach-Object -Process {
if ($ false -eq $ _. GetFileSystemInfos ())
{
$ _. FullName
}
}
Note: PowerShell only supports scanning junk folders on each drive partition on your computer. So, you need to enter the name of the drive partition to be scanned in the Drive Name section.
For example: A software trick that wants to scan empty folders on the E: drive of the computer will enter the following command:
$ SomePath = 'E:'
Get-ChildItem -Path $ SomePath -Recurse -Directory | ForEach-Object -Process {
if ($ false -eq $ _. GetFileSystemInfos ())
{
$ _. FullName
}
}
Step 3: After entering the command is complete, press Enter to launch the system and scan for junk folders on Windows. When the scan of empty folders on Windows is completed, you will get a list of empty folders that can be deleted as shown below.
In Part 1, we learned about the list of empty folders, junk folders on Windows 10 and the job is to delete these folders. To delete empty folders on Windows 10, do the following:
Step 1: In the PowerShell window, just check an empty folder on Windows, you proceed to highlight a path and press Ctrl + C to copy.
Note: It is advisable to follow the order in turn from top to bottom or vice versa to avoid confusion.
Step 2: Then, open MenuStart and enter File Explorer to open the Windows data manager.
Step 3: Next, click the path bar in File Explorer and press Ctrl + V to paste the path in PowerShell. When you paste the path, press Enter to open it.
Step 4: So you have opened an empty folder, a junk folder on your computer. Now you press the Back button to return to the folder storage and delete them.
Step 5: Finally, right-click on the empty folder name and select Delete to delete as usual.
In this article, TipsMake instructed you how to check and delete empty folders, junk folders on Windows 10. Only with such simple steps you can clean empty folders on Windows 10 quickly. quick!
Good luck.