Why some folders are not deleting in Windows 10?

It can be frustrating when you try to delete a folder in Windows 10 but you get an error saying the folder cannot be deleted or removed. There are several potential reasons why you may be unable to delete certain folders on your Windows 10 computer.

In this article, we will go over some of the common causes and troubleshooting steps to take when you encounter the issue of folders not deleting in Windows 10. Understanding why some folders won’t delete can help you identify and resolve the problem.

Common Causes

There are a few common reasons why you may not be able to delete a folder in Windows 10:

Permissions Issues

If you don’t have permission to delete a folder, you’ll get an “Access denied” error when trying to delete it. This is commonly seen with folders like Windows, Program Files, and Users. To delete these protected folders, you need administrator access. If you’re not logged into an admin account, try logging into one or using the Run As Administrator command when deleting the folder.

See this article for help on taking ownership of folders and bypassing permissions issues: https://www.minitool.com/news/how-to-force-delete-a-file-that-cannot-be-deleted-009.html

Folder in Use

If a folder contains a file that’s currently in use or open, you may get errors trying to delete the folder. Any apps, processes, or services using files inside the folder can prevent deletion. Try closing any open programs that could be accessing the folder before deleting.

You can also try rebooting your PC to clear any locks, or using Unlocker utility to force delete in-use files according to this guide: https://www.salvagedata.com/cant-delete-file-in-windows-10/

Folder Ownership

By default, folders you create are owned by your user account. If you don’t have ownership of a folder, you can’t delete it without taking ownership. To check ownership and permissions, right-click the folder > Properties > Security tab. You can take ownership to delete the folder.

Permissions

One of the most common reasons a folder won’t delete in Windows 10 is due to permission issues. Windows uses a permissions system to control access to files and folders. There are different permission levels like Read, Write, Modify, etc. By default, most user folders allow the logged in user full control. However, system folders and some folders created by other applications will assign permissions that prevent deletion without admin access.

To check permissions on a folder, right-click on it and select Properties. Go to the Security tab. Here you can see the current permissions assigned to Users and Groups. If your account doesn’t have Full Control or Modify access, you’ll need to edit the permissions to allow deletion. Be careful editing system folder permissions.

To modify permissions, go back to the Security tab and click Edit. Add your user account with Full Control or Modify permissions. If you want to delete the folder without changing permissions, run File Explorer as Administrator and try deleting again. You can also take ownership of the folder [1].

Folder in Use

One common reason a folder may not delete in Windows 10 is because the folder is currently in use or open by another process or program. Windows implements folder locks to prevent deleting or modifying folders or files that are currently being accessed by a running program. This prevents errors or data corruption that could occur if a folder was deleted while it was still open.

Some examples of programs that may lock folders include Windows Explorer, MS Word, Command Prompt, anti-virus scanners, backup software, etc. Any time a program needs to access files within a folder, it will lock that folder to prevent other programs from interfering. Windows itself may also lock certain system folders that are required for proper functioning.

To delete a locked folder, you must first close any programs that may be using that folder. Save and close any open Explorer windows showing the contents of the folder, exit programs like MS Word that may have files open, and end any command prompt sessions pointing at the folder path. Restarting the computer can clear any stuck folder locks. Then you should be able to delete the folder successfully.

You can use Task Manager (Ctrl + Shift + Esc) to end processes that have locked folders open. But be cautious, as force closing programs may result in lost data. Sometimes it is better to leave a program open temporarily until it finishes its task, then you can delete the folder after it closes normally.

Ownership

File and folder ownership refers to the user account that has full control permissions for that item. By default in Windows 10, you are the owner of files and folders you create. Ownership gives you full control to modify, delete, take ownership, or change permissions of a file or folder.

You can view a file or folder’s ownership under the Security tab in Properties. The owner will be listed at the top. To change ownership, click Advanced, then Change next to the owner name, and select a new owner. Be aware that changing ownership can lead to permission issues, so it’s best to only modify ownership if absolutely necessary.

Sometimes folders can’t be deleted if you are no longer the owner, or ownership was changed from your user account. To fix this, you need to take back ownership by opening Properties > Security > Advanced > Change owner to your username. Now you can modify the folder again or delete it if needed.

References:

How to remove file ownership in windows 10. (n.d.). Retrieved from https://answers.microsoft.com/en-us/windows/forum/all/how-to-remove-file-ownership-in-windows-10/53d52e20-45aa-4821-bc3a-42ce9d2f3192

How To Remove “File ownership” In File Explorer on Windows 10. (2020, October 15). Super User. https://superuser.com/questions/1594595/how-to-remove-file-ownership-in-file-explorer-on-windows-10

Protected System Folders

Windows includes certain system folders that are protected by default and cannot be deleted. These folders contain critical operating system files and settings that ensure your device runs properly. Some examples of protected system folders in Windows 10 include:

https://learn.microsoft.com/en-us/microsoft-365/security/defender-endpoint/controlled-folders?view=o365-worldwide

  • C:\Windows
  • C:\Program Files
  • C:\Program Files (x86)
  • C:\ProgramData

Attempting to delete these folders through the user interface or command line will result in an “Access Denied” error. Modifying protected system folders can lead to instability, crashes, or other problems.

Some third-party apps may request access to write to protected folders through the controlled folder access feature in Windows Security. This allows trusted apps to function properly while still protecting against malicious changes. But in general, users should avoid tampering with protected system folders.

File Path Issues

One common reason a folder may fail to delete in Windows 10 is due to the file path length exceeding the maximum supported by the operating system. By default, Windows uses a maximum path length limit (MAX_PATH) of 260 characters for the full path and filename [1]. If a folder is nested deep in the file structure or has a long name, it can hit this limit.

For example, a folder located at “C:\Users\YourName\Documents\Project Files\Final Renderings\Client A\Detailed Images\Architecture” may run into the path limit. When trying to delete a folder exceeding the MAX_PATH length, you’ll get errors like “File Path Too Long” or “Path too deep.”

In newer Windows 10 versions after 1607, Microsoft has removed the path length limitation for many Win32 functions [1]. However, some parts of the operating system still enforce the 260 character maximum. To fully resolve path errors, you may need to restructure your folder organization to shorten names and paths.

Corruption

Sometimes a folder cannot be deleted due to file system corruption or damaged files. This can prevent Windows from properly accessing the folder structure and contents. Corruption usually occurs from improper shutdowns, power outages, drive failures, or viruses/malware. It can cause inconsistencies in the file system metadata that tracks folders and their contents. The most common sign is getting errors when trying to access files or folders.

The main utility on Windows for checking and repairing corruption is CHKDSK (Check Disk). Running CHKDSK scans the drive and looks for inconsistencies and damage. It can fix many errors automatically by rebuilding folders and repairing the file system structure. To run CHKDSK, open an elevated Command Prompt and type “chkdsk C: /f” to scan drive C, automatically fixing any errors. Alternately, “chkdsk C: /r” performs a deeper scan and recovery. See Use CHKDSK to Fix the Corruption Problem on Windows 10 and How to Use CHKDSK to Repair & Fix Windows Hard Drives for more details on using CHKDSK to resolve corruption issues.

Troubleshooting

If you are unable to delete a folder in Windows 10, there are some steps you can take to troubleshoot and resolve the issue.

Check Folder Permissions

One of the most common reasons a folder may not be deleting is due to incorrect permissions settings. To check the permissions on a folder that will not delete:

  1. Right click on the folder and select Properties.
  2. Go to the Security tab.
  3. Click Advanced.
  4. Make sure your user account has Full Control permissions for the folder. If not, you can add your user account and grant Full Control.

In some cases, you may need to take ownership of the folder before you can delete it. To do this:

  1. Right click the folder, select Properties, and go to the Security tab.
  2. Click Advanced, then click the Owner tab at the top.
  3. Select your username, click Change, and click OK to take ownership.

Now that you have taken ownership, retry deleting the folder.

Use Safe Mode

If a program or process is using the folder, deleting it in Safe Mode can help. To access Safe Mode:

  1. Open the Start menu and click the Power button.
  2. Hold down the Shift key while clicking Restart.
  3. On the Choose an Option screen, select Troubleshoot.
  4. Click Advanced Options.
  5. Click Startup Settings, then click Restart.
  6. After your PC restarts, select Safe Mode with Networking.

Now try deleting the folder again while in Safe Mode.

Use the Command Prompt

The Command Prompt gives you access to more delete options. To force delete a folder from the Command Prompt:

  1. Type cmd in the Windows search box and open the Command Prompt
  2. Type the command: rmdir /s /q foldername (replace foldername with the path to your folder)
  3. Press Enter. This will remove the directory and all its contents.

If the folder still won’t delete, you may need to reformat your hard drive to fix corruption issues.

When To Reset

Resetting Windows 10 can be an effective troubleshooting step if you are unable to delete files or folders due to corruption or other issues. Before resetting, it’s crucial to backup your personal files and data ([1]). There are two main reset options in Windows 10:

  1. Keep My Files – This option removes apps and settings, but keeps your personal files.
  2. Remove Everything – This option resets Windows 10 completely back to factory settings.

The Keep My Files option is safer if you just want to troubleshoot file deletion issues, as it preserves your data. The Remove Everything option should only be used as a last resort if Keep My Files does not resolve the problem.

After backing up your files, you can access the reset options by going to Settings > Update & Security > Recovery. It’s recommended to first try the Keep My Files option. If the issues persist, you can then use the more aggressive Remove Everything option.

Resetting Windows 10 has been known to resolve many types of performance issues, software errors, and file system corruption problems. Just be sure to exhaust all other troubleshooting methods first before resetting your system.

[1] https://answers.microsoft.com/en-us/windows/forum/all/reset-windows-10-now-i-cannot-delete-any-of-my-old/79de6ec9-7dd5-4686-ac6d-ee9553b40990