Can not delete files in File Explorer:

Table of Content:

About:

So you have a file in File Explorer that you can not delete, no matter what you try. What do you do?

Why it happens:

  1. The filename is too long.
  2. The filename includes invalid characters.
  3. The One Drive isn't sync'd.
  4. The file is corrupted.

You have tried:

  1. Deleting the file using the cmd command:
cd "C:\path\to\folder"

del "filename.pdf/txt"
  1. Close all programs that might be using the file.

  2. Check file permissions. Ensure your user account has Full control.

  3. End tasks in Task Manager.

  4. Check if the file name contains invalid characters. Rename it.

cd "C:\path\to\folder"

ren "\\?\C:\path\to\file.pdf" "newname.pdf"

How to fix:

Attempt 1 - Rename file:

Sometimes the file can be deleted again when the long filename is shortened. When you can not rename it the normal way, try this method:

  1. Download WinRAR or 7-Zip and run it. Locate the file.
    55aa.png

  2. Right click the file and choose rename. This should work. 56aa.png

  3. Now you can delete the file in the original folder. 😄