/
/

How to Delete a Corrupted Folder in Windows 11

by Ann Conte, IT Technical Writer
How to Delete a Corrupted Folder in Windows 11 blog banner image

Instant Summary

This NinjaOne blog post offers a comprehensive basic CMD commands list and deep dive into Windows commands with over 70 essential cmd commands for both beginners and advanced users. It explains practical command prompt commands for file management, directory navigation, network troubleshooting, disk operations, and automation with real examples to improve productivity. Whether you’re learning foundational cmd commands or mastering advanced Windows CLI tools, this guide helps you use the Command Prompt more effectively.

Key Points

  1. Identify the error message first. Determine if it’s “Access is denied,” “File or directory is corrupted and unreadable,” or error 0x80070570 to choose the correct fix.
  2. Repair file system corruption with CHKDSK (first step). Run this command in Windows Terminal (Admin):
    chkdsk X: /f
    Use /r if disk damage is suspected.
  3. Reset folder permissions if access is denied. Use:
    takeown /f "folderpath" /r /d y
    icacls "folderpath" /grant administrators:F /t
  4. Force delete the corrupted folder.
    rmdir /s /q "folderpath"
    Or in PowerShell:
    Remove-Item -LiteralPath "folderpath" -Force -Recurse
  5. If deletion fails, use Safe Mode or fix long path errors. Boot into Safe Mode or use the \\?\ prefix for path length issues.

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, if they failed with 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 and go to 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.

Follow the video for How to Delete a Corrupted Folder in Windows 11 — all five methods covered.

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.

  1. Open the Start Menu, search for Command Prompt > Right-click > Run as administrator.
  2. 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.

  1. Open the Start Menu, search for Windows PowerShell > Right-click > Run as administrator.
  2. 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.

  1. Open the Start Menu > Settings > System > Recovery > Advanced startup > Restart now.
  2. Go to Troubleshoot > Advanced options > Startup Settings > Restart.
  3. Once it restarts, press 4 to enable Safe Mode.
  4. Delete the corrupted folder using File Explorer or Windows PowerShell.
  5. 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.

  1. Open the Start Menu and search for Command Prompt. Right-click and choose Run as administrator.
  2. 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.
  1. Restart the computer.
  2. 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.

  1. Open the Start Menu, search for Command Prompt > Right-click > Run as administrator.
  2. 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

  1. 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

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. This could have caused 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.

Quick-Start Guide

Here are several methods to fix a corrupted folder in Windows 11 that you cannot delete:

1. Command Prompt Method:
– Open Command Prompt as an administrator
– Use the command: rd /s /q “full_path_to_folder”
– The /s switch removes all subfolders and files
– The /q switch executes in quiet mode

2. Take Ownership Method:
– Open Command Prompt as administrator
– Use the command: takeown /F “full_path_to_folder” /R /A
– Then: icacls “full_path_to_folder” /grant administrators:F /T
– This grants full permissions to administrators

3. Safe Mode Deletion:
– Restart Windows in Safe Mode
– Try deleting the folder again

4. Alternative Tools:
– Use file unlocker tools like 7-Zip (try adding the folder to an archive with “delete files after compression” option)
– Boot from a Linux live USB to delete the folder

5. Chkdsk Utility:- Run chkdsk /f to check and repair disk file system errors

NinjaOne Specific Note: While NinjaOne doesn’t have a direct built-in tool for this specific issue, their Remote Tools and file management capabilities might help in some scenarios.

Caution: Always backup important data before attempting these methods, as they involve system-level file manipulation.

FAQs

Even if you’re logged in as an administrator, Windows may block deletion if the folder is owned by another user, locked by a running process, or protected by system permissions. You may need to reset ownership and permissions using takeown and icacls, or boot into Safe Mode to release locked files before deleting it.

It is generally safe to force delete a corrupted folder if it is not a system directory and does not contain critical data. However, if the corruption is caused by disk errors, you should first run CHKDSK and back up important files. Force deletion does not fix underlying disk problems.

A folder can become corrupted due to sudden power loss, improper shutdowns, disk errors, bad sectors, malware, or file system corruption. Corruption is commonly associated with error messages like “File or directory is corrupted and unreadable” or error 0x80070570.

No. Deleting a corrupted folder removes the visible issue, but it does not repair the underlying file system or disk errors. To properly fix disk problems, run:

chkdsk X: /f

If bad sectors are suspected, use /r and back up your data immediately.

You might also like

Ready to simplify the hardest parts of IT?