How to delete files and folders that won’t delete in Windows?

Unable to delete files and folders? Here, Try these 7 fixes

You may face an issue when trying to delete a file or folder. During this, the selected item is stuck on an endless deletion prompt loop and still isn’t deleted from your system. This is a common occurrence and can happen when the selected item is under the use of another program. This causes Windows to lock the file or folder until the program has fully used it.

Files and folder are not deleting from Windows
Files and folders are not deleted from Windows Fix

In this guide, we have given the methods to delete any file or folder that has been locked from your access.

Workaround: Perform a System Restart 

When facing the issue where the selected files and folders are stuck on the deletion prompt, you must restart your system. This will restart all processes on the system that may be interfering with the deletion process.

If the file you are trying to delete is being used by a process that is started by user, please make sure that the process is completed before performing a System Restart otherwise, it might lose the progress and you might have to do it all over again.

Perform a System Restart by following the steps below:

  1. Close all tabs running on the system.
  2. Open the Windows Start Menu by pressing the Win key.
  3. Restart the system by clicking on the Power option and selecting “Restart.”
    Restarting the Windows computer
    Restarting the Windows computer
  4. After the system is restarted, delete the files and folders.

1. Run the Disk Checker

A corrupted disk will also be a reason why you are facing this error as it interferes with the normal performance of the system. To ensure that your disk is not facing any corruption, you must perform the Disk Checker that scans your disk and repairs the detected errors on it. You can perform the Disk Checker by following the steps:

  1. Open the Windows Start Menu by pressing the Win key.
  2. Type “cmd” in the Windows Search bar.
  3. Run the command prompt as an administrator by right-clicking on it and selecting the”Run as an administrator” option. 
    Running the Command Prompt as an administrator
    Running the Command Prompt as an administrator.
  4. Run the Disk Checker by copying and pasting the following command into the command prompt and pressing the Enter key:
    chkdsk /f /r C:
  5. After the scan is completed, restart your computer to make the necessary changes.

2. Run the System Scans

Your System Files when corrupted will also lead to this error. Corruption in the system files stops certain activities on the system from performing. Therefore, you must ensure that the system files are not corrupted by performing System Scans that detect and repair the issue found with your computer. You can do that by following the procedure given below:  

  1. Open the Windows Start Menu by pressing the Win key.
  2. Type “cmd” in the Windows Search bar.
  3. Run the command prompt as an administrator by right-clicking on it and selecting the”Run as an administrator” option. 
    Running the Command Prompt as an administrator
    Running the Command Prompt as an administrator.
  4. Type the following command in the Command Prompt while giving a space between “sfc” and “/.”
    sfc /scannow
    Running system file checker on the command prompt.
    Running system file checker on the command prompt.
  5. After completing the scan, the file checker will automatically repair the defective files. 
Note: After the System File Checker has scanned the entire system, you must run the DISM Command through the given steps:
  1.  To run the DISM command, Paste the following command into the command prompt.
    Dism.exe /online /cleanup-image /restorehealth
    Running DISM Command on the Command Prompt
    Running DISM Command on the Command Prompt
  2. Restart your computer and to the necessary changes. 

3. Remove the directory through the command prompt

When facing this issue, you may not have administrative permissions to delete the files and folder. Therefore, you must use the command prompt as an administrator to automatically delete the directory from your system without sending the files to the Recycle Bin. Below are the instructions to remove the directory from the command prompt:

  1. Open the File Explorer and Select and File or folder you want to delete.
  2. Copy the path of the file or folder from the search bar above.
  3. Open the Windows Start Menu by pressing the Win key.
  4. Type “cmd” in the Windows Search bar.
  5. Run the command prompt as an administrator by right-clicking on it and selecting the”Run as an administrator” option. 
    Running the Command Prompt as an administrator
    Running the Command Prompt as an administrator.
  6. Delete the selected File by typing the following command in the Command Prompt and pressing the Enter Key:
    del /f /q /a "paste the copied path here" 
  7. Now, remove the directory by typing the following command into the Command Prompt and pressing the Enter key:
    rmdir /s /a "paste the folder path here"
    Deleting File and Folder
    Deleting File and Folder

4. Remove the File from Windows Powershell

Another way you can remove any file from File Explorer is through the use of Windows PowerShell. This is a built-in command line that is similar to the Command Prompt but has more extensibility. Using the steps below, you can remove the file from the Windows PowerShell:

  1. Open the Windows Start Menu by pressing the Win key.
  2. Type “PowerShell” in the Windows Search bar.
  3. Run the Windows Powershell as an administrator by right-clicking on it and selecting the”Run as an administrator” option. 
    Running Windows Powershell as an administrator
    Running Windows PowerShell as an administrator
  4. Remove the item from the directory by typing the following command into the Windows PowerShell and pressing the Enter Key:
    remove-item -path "paste the path of the item here"
    Removing directory from the Windows PowerShell
    Removing the directory from the Windows PowerShell

5. Use the Program Take Ownership

One of the reasons why you can’t delete the files is that you don’t have permission to perform the deletion from your system, especially if you are the only user of the device.

If you are uneasy using a third-party program, you can follow our guide on How to use built-in Takeown Command in Windows to take permissions and remove files from your Windows.

Therefore, using the Take Ownership program, you can take complete ownership of all files and folders on your system and delete them as per your choice. Below is how you can download and use the program:

  1. Open the Official Website to download the Take Ownership program. 
  2. Download the program by clicking on the “Download Now” option. 
    Downloading the Take Ownership Program
    Downloading the Take Ownership Program
  3. Select the location where you prefer to save the file and click the “Save” option.
    Saving file in directory
    Saving files in the directory
  4. Open the Browser Downloads page by clicking on the three dots in the top right corner and clicking on the “Downloads” option.
    Opening the Downloads tab
    Opening the Downloads tab
  5. Open the location of the file by clicking on the “Show in Folder” option.
    Showing zip file in the folder
    Showing zip file in the folder
  6. Extract the zip folder by right-clicking on it and clicking on the “Extract here” option.
    Extracting the File
    Extracting the File
  7. To take ownership, double-click on the “Add Take Ownership to Context menu” Registry File and select the YES option on the Registry Editor Message Box.
    Giving Registry Permission
    Giving Registry Permission
  8. Now, right-click on the files you want to delete, click on the “Take Ownership” option, and simply delete them. 
    Taking Ownership of the file
    Taking Ownership of the file

6. Use the Unlocker Program 

Unlocker is a convenient program that allows you to Unlock files and folders and provides you access to them is the Unlocker.  If you’re comfortable with using freeware to unlock and delete Windows files, you can follow the instructions below to install and use the Unlocker program:

  1. Open the Official Website to download the Unlocker program. 
  2. Download the program by clicking on the “Download Now” option. 
    Downloading the Take Ownership Program
    Downloading the Take Ownership Program
  3. Select the location where you prefer to save the file and click the “Save” option.
    Downloading the Unlocker Portable program
    Downloading the Unlocker Portable program
  4. Open the Browser Downloads page by clicking on the three dots in the top right corner and clicking on the “Downloads” option.
    Opening the Downloads tab
    Opening the Downloads tab
  5. Open the location of the file by clicking on the “Show in Folder” option.
  6. Extract the zip folder by right-clicking on it and clicking on the “Extract here” option.
    Extracting the File
    Extracting the File
  7. Open the Application by right-clicking on it and selecting the “Open” option. 
    Opening the exe Application
    Opening the exe Application
  8. Select the file you want to delete in the “Browse for Files or Folders” Box and click on the OK option.
    Selecting the file to Delete
    Selecting the file to Delete
  9. Delete the file by clicking on the “No action” drop menu and selecting the “delete” option.
  10. Click OK to confirm the process and delete the file from your system. 
    Deleting the file
    Deleting the file

7. Delete the File/Folder in Safe Mode

If the error persists when using the system in a Normal State, then you must boot the system on Safe Mode to delete the file/folder. This Mode will allow the system to start with default programs and a minimal set of drivers and will help you find the problem as well. You can run the System on Safe Mode as follow:

  1. Open the Run Command by pressing the Win + R keys together.
  2. Open System Configuration by typing “msconfig” in the search box and clicking OK.

    Opening System Configuration
    Opening System Configuration
  3. Open the Boot tab and check the “Safe Mode” box.
  4. Click and select the “Minimal” option under Safe Mode.
  5. Set the timer as per your preference.
  6. Make the changes by clicking Apply and OK.
    Booting System on Safe Mode
    Booting System on Safe Mode
  7. Restart your computer by selecting the “Restart” option on the System Configuration Prompt.
    Restarting computer
    Restarting computer
  8. Once you are booted into Safe Mode, you must delete the files and folders at fault as now they will not be interred by any third-party software in safe mode. 
  9. After deleting the files, you can get out of Safe Mode.

8. Perform a Clean Boot

If you are still facing the error, then you must Perform a Clean Boot on your system. Performing a Clean Boot will boot the system on a minimal set of drivers and startup programs. However, when doing so, you must make a backup copy of your files on the system in case your data gets deleted. 

ABOUT THE AUTHOR

Muhammad Zubyan


Muhammad Zubyan is a certified Google IT Support Professional with over 7 years of extensive experience. He has worked on more than 1500 computers, gaining valuable insights that enable him to detect and troubleshoot any complicated root cause of Windows-related issues and errors. In addition to managing Appuals as a Senior Editor, he is currently developing his own Game Optimization program that caters to both gamers and casual users alike.