Sometimes, you’ll find that you cannot delete a corrupted folder. Trying to do so will result in errors like “Could not find this item,” “Access is denied,” or “The file or directory is corrupted and unreadable.”
It’s important to learn how to troubleshoot a problem like this and how to permanently delete the files. It will free up storage space, especially if the corrupted files and folders are old and broken directories or failed software installs and updates. Users typically no longer need them, and the storage space can be better allocated for other uses.
5 methods to delete corrupted folders in Windows 11
There are many ways to delete a corrupted folder. You can do it via Command Prompt or Windows PowerShell. If you have additional needs and considerations, you can also delete the corrupted folder in Safe Mode or run CHKDSK. If you are having problems with folder access or permissions, you may also try taking ownership of the folder and resetting its permissions.
Prerequisites before deleting a corrupted folder
Before getting started, here are a few things to consider:
- You will need administrator access to execute the options in this guide. To check if you have the necessary permissions, open the Start Menu > Settings > Accounts. The word “Administrator” should be printed under your username.
- Make sure that the folder and its contents are currently not being used by any program or process.
- Avoid deleting any system folders unless you are absolutely certain that it will not be detrimental to your overall system.
Method 1: Delete folder via Command Prompt (basic)
This is a more aggressive method than simply deleting the folder from File Explorer and will bypass the Recycle Bin completely.
- Open the Start Menu, search for Command Prompt > Right-click > Run as administrator.
- Run the following script and press Enter:
rd /s /q "[File path to the corrupted folder]"
-
/s
– Will remove all subfolders and files/q
– Will execute the script in quiet mode, meaning there will be no prompts- If the file path contains spaces, don’t forget to wrap it in spaces.
Method 2: Use PowerShell to force delete the corrupted folder
Windows PowerShell gives you more detailed error handling and script flexibility. If you’re in an enterprise environment, you can launch these scripts using a remote PowerShell tool.
- Open the Start Menu, search for Windows PowerShell > Right-click > Run as administrator.
- Run the following script and press Enter:
Remove-Item -LiteralPath "[File path to the corrupted folder]" -Force -Recurse
-
-Force
– Will suppress errors if there are read-only files in the folder.-Recurse
– Removes all content in the folder.
Method 3: Unlock the folder via Safe Mode
If you cannot delete a corrupted folder because it’s locked by a third-party application or service, Safe Mode can prevent that from happening the next time you try.
- Open the Start Menu > Settings > System > Recovery > Advanced startup > Restart now.
- Go to Troubleshoot > Advanced options > Startup Settings > Restart.
- Once it restarts, press 4 to enable Safe Mode.
- Delete the corrupted folder using File Explorer or Windows PowerShell.
- To exit Safe Mode, restart your computer.
Method 4: Run CHKDSK to repair file system corruption
Sometimes, a folder is unreadable because of disk corruption. In that case, run CHKDSK.
- Open the Start Menu and search for Command Prompt. Right-click and choose Run as administrator.
- Run the following script and press Enter:
chkdsk [Drive letter that contains the corrupted folder] /f
-
/f
can fix the logical errors on the disk.
- Restart the computer.
- Use Command Prompt or Windows PowerShell to delete the folder.
Method 5: Take ownership and reset permissions
Sometimes, you are unable to delete a corrupted folder due to permission problems. Taking ownership of the folder may resolve that.
- Open the Start Menu, search for Command Prompt > Right-click > Run as administrator.
- Run the following script and press Enter:
takeown /f "[File path to corrupted folder]" /r /d y
icacls "[File path to corrupted folder]" /grant administrators:F /t
- Once you’ve taken ownership of the folder, try deleting it with this script:
rd /s /q "[File path to corrupted folder]"
Additional considerations before deleting a corrupted folder in Windows 11
- You can use
\\?\
in Command Prompt to delete very long file paths. It will look something like this:rd /s /q "\\?\[Very long file path]"
- If folders keep getting corrupted, consider running sfc /scannow and DISM /Online /Cleanup-Image /RestoreHealth in Command Prompt to see and address the underlying issues.
- Make sure that the folder is not encrypted by something like BitLocker encryption.
Method 6: Use a third-party tool
You can also use third-party tools like LockHunter or Unlocker to identify what’s preventing the folder from being deleted and forcefully remove it from the computer. `Always ensure you are downloading an app from its official page or website. Please also be mindful when deleting folders, as they may contain system-critical files.
How do folders get corrupted?
There are many reasons a folder or files get corrupted. The device might have experienced a sudden outage or power surge while the files were being written, causing it to get corrupted. There may also have been some software or system issues. If the software or your operating system suddenly crashes while the files are being written, the file might get corrupted.
Aside from internal issues, a file can be corrupted because of outside actors as well. If you recently experienced a malware or virus attack, it might have left some of your files and folders corrupted and unusable.
Why resolve corrupted folder deletion issues?
Deleting corrupted files and folders can bring many benefits to the end user. It can free up storage space, especially if the corrupted folders are old and broken directories or old software files that no longer work.
It’s also a good way to maintain system hygiene. Making sure that all files are usable and relevant to the user’s needs. It streamlines their workflows and minimizes errors, in case a user tries to launch corrupted files.
Ensuring seamless deletion of a corrupted folder in Windows 11
There are several ways to delete a corrupted folder from Windows 11, with Command Prompt and Windows PowerShell being useful tools for that. If the issue is due to disk corruption, CHKDSK may help resolve the issue. Booting into Safe Mode before deleting the corrupted folder can help stop third-party applications or services from restricting access to it. And if the problem is because of access or permission issues, consider taking ownership of the folder and resetting its permissions.