How to delete a file that is not deleted in Windows 10

A file or folder deletion error can be caused by a variety of reasons, ranging from a file being held by a system process to a user not having access rights.

Method 1: Restart the PC

The first thing to try when faced with the problem described is to simply restart the computer. If the problem was caused by some small glitch or one of the running programs has blocked the deletion, after restarting the system the file will be deleted on the first try.

Method 2: Uninstall in "Safe Mode"

If a file is still being held by a non-critical system or third-party process, booting the PC into "Safe Mode"..

  1. Open with a shortcut key Win + R quick command window, type msconfig and press «OK».
  2. In the utility window that opens "System configuration". switch to tab "Load".check the option box "Safe Mode". and confirm with the button «OK».
  3. Confirm the restart of the computer.

Once Windows 10 has booted into safe mode, try deleting the problem file as normal. To boot into normal mode, run the utility again "System configuration". and tab "General". activate option "Normal start-up", then save the settings and reboot.

Method 3: Use a filing cabinet

This solution can be effective if you need to delete a file or folder with a long path or dots/spaces at the end of the file name. Any popular archiver will do, for example WinRAR or 7-Zip. Let's consider file deletion using WinRAR as an example.

Download WinRAR

  1. Right-click the file that cannot be deleted, and from the context menu select "Add to file"..
  2. Give a short name to the file to be created, in the file options activate the option “Delete files after archiving” option and press the button «OK».

Since most archivers ignore the long path restrictions in Windows, the file should be removed without any problem. After that, delete the file itself as well.

Method 4: Use the command line

To remove files with long paths or invalid names, you can use the classic "Command line"..

  1. Start the console from a Windows 10 search - it's the fastest way to find it. Call to Command Prompt. must be run as administrator.
  2. Generate and execute a command in the console of the form del \\?\C:\fullpath.txtwhere C – the drive letter, and full path – full path of the file to be deleted, including its name (example on the screenshot). If there are periods or problems at the end of the file name, don't forget to specify them, as they are also part of the path.

Method 5: Change permissions

Lack of user access rights to an object is one of the most common causes of a file deletion error. This can be resolved by getting full permissions to the file and then trying to delete the object again.

Option 1: Windows Tools

  1. Open "Properties". of the problem file.
  2. In the properties window that opens, switch to the tab "Security". and press the button "More".
  3. Click on "Inheritance Deactivation" in the window "Additional security settings.".
  4. Select an option "Convert inherited permissions to explicit permissions for this object".
  5. Make sure that you, as a user or administrator, are the owner of the file. If not, click the link "Change".to proceed with the change of ownership.
  6. Enter your local username or your Microsoft account name in the user or group selection box that opens, and tap "AGREE"..
  7. Save the configuration.
  8. Click on the previous window "Properties". button "Change"..
  9. If the desired user or group is not listed, click the group permissions checkbox "Add". and add a user or administrator (yourself) as shown in step 6.
  10. Select the group you belong to ("Administrators" o "Users".) and set full access rights for it. Save the changes made.

Option 2: TakeOwnershipEx utility

An easier way to gain access rights to a file or directory is to use the third-party TakeOwnershipEx utility. This little free solution allows the current user to get permissions on an object with a single click.

Download TakeOwnershipEx from the official website

  1. Download the archive with the utility from the official page of the developer and unpack it.
  2. Run the TakeOwnershipEx- executable file and install the utility.
  3. Right-click on the problematic file and from the context menu select the option “Gain access/restore rights”.
  4. If successful, the utility will return a message "Full access to file/folder obtained".

Method 6: Using Unlock Utilities

To remove so-called unremovable files in Windows 10 you can use specialized unlocking applications. They can also be used to remove files and folders with long or invalid names. Here you will find a list of these tools, as well as examples of their use.

Read more: Software to delete files that cannot be deleted

Method 7: Use a Linux LiveCD

This is the most reliable and efficient, but also the most complicated way to get rid of an unrecoverable file or any other object. Its essence is to gain monopoly access to the computer's file system by booting it from a Linux-based LiveCD. Any LiveCD with an onboard file manager will do, so the Puppy Linux distribution is used in this example.

Read More:
Instructions for writing a LiveCD to a USB stick
Software to create a bootable USB stick

  1. Download a boot image and write it to a flash drive using Rufus or similar software.
  2. Boot your computer from the LiveCD.

    Also Read: Configure BIOS to Boot from USB Stick

  3. Select the partition on the Linux desktop with the file you want to delete. If you don't know which partition it is, check them all one by one.
  4. Right-click on the file you want to delete and select the option "Delete".
  5. Confirm the deletion by pressing the button "Yes".

The procedure for deleting files on other LiveCDs may be slightly different, but the essence is the same.