/
/

How to Delete a Corrupted Folder in Windows 11

How to Delete a Corrupted Folder in Windows 11 blog banner image

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.

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

You might also like

Ready to simplify the hardest parts of IT?
×

See NinjaOne in action!

By submitting this form, I accept NinjaOne's privacy policy.

NinjaOne Terms & Conditions

By clicking the “I Accept” button below, you indicate your acceptance of the following legal terms as well as our Terms of Use:

  • Ownership Rights: NinjaOne owns and will continue to own all right, title, and interest in and to the script (including the copyright). NinjaOne is giving you a limited license to use the script in accordance with these legal terms.
  • Use Limitation: You may only use the script for your legitimate personal or internal business purposes, and you may not share the script with another party.
  • Republication Prohibition: Under no circumstances are you permitted to re-publish the script in any script library belonging to or under the control of any other software provider.
  • Warranty Disclaimer: The script is provided “as is” and “as available”, without warranty of any kind. NinjaOne makes no promise or guarantee that the script will be free from defects or that it will meet your specific needs or expectations.
  • Assumption of Risk: Your use of the script is at your own risk. You acknowledge that there are certain inherent risks in using the script, and you understand and assume each of those risks.
  • Waiver and Release: You will not hold NinjaOne responsible for any adverse or unintended consequences resulting from your use of the script, and you waive any legal or equitable rights or remedies you may have against NinjaOne relating to your use of the script.
  • EULA: If you are a NinjaOne customer, your use of the script is subject to the End User License Agreement applicable to you (EULA).