How to delete files or folders which cannot be deleted

29. April 2016 How to, Windows 1
How to delete files or folders which cannot be deleted

How to delete files or folders which cannot be deleted

At times you may find to delete files or folders which cannot be deleted on your Windows computer. When you go to delete such undeletable files or folders you may get an Error message: Could not find this item.

 delete files or folders which cannot be deleted

So what the problem is?

Sometimes the folder name is something like “My Folder “, If you look at the end of file you have noticed, there is a space at the end of file. If you have installed Windows 8, 8.1 or even 10 on your PC, you can try to create a folder which ends with a space and you will see that Windows will automatically remove that space which is located at the end or the beginning of the file name!

That’s the problem!
In previous versions of Microsoft Windows, such as XP or Vista, I think Windows let users to create a file or folder with trailing space.

For example: I have folder which is called “New Folder “, (look at the space at the end!)
When I try to remove it in Windows Explorer, Windows will try to remove “New Folder” (without space at the end) and it will give me an error “Could not find the item”.

 So, lets see how to delete files or folders which cannot be deleted:

  1. Right click on Windows button and select “Command prompt (Admin).”
    command prompt with admin rights
  2. Then locate the folder in which you have the file or folder which you want to delete.
    locate the file or folder which you want to delete
  3. Now type cd and copy the address where your folder or file is located and paste it in command prompt or cmd like this: [just edit your path not this one]
    cd c:\Users\YourUserName\Desktop
    And then press enter.
    cd command
  4. After that you will see that you are inside the folder because your path has changed, now type this:
    dir /x
    and then press enter again.
    dir x cmd
  5. After that you will see list of files in the folder and search for your folder or file which you can’t delete.
    In my case it is AFTERE~1
  6. Now after finding the file, see it has a specific name something like ABCD~1 and not the actual file name.
  7. Type the following line, just edit the filename with the name which you find above which is allotted to your file name:
    rmdir /q /s your file name
    and then press enter.
     delete files or folders which cannot be deleted
  8. Finally you have successfully deleted the folder, go and check.
    folder finally deleted with cmd

It seems this fix was easy and you no longer have to deal with unwanted files or files which cannot be delete. If you still have any queries regarding this guide please feel free to ask them in comments.

 

Follow me

adityafarrad

Aditya is a Windows Technical expert and being a passionate Windows Blogger, he loves to troubleshoot system issues and help others.
Follow me

Latest posts by adityafarrad (see all)

Comments

comments


1 thought on “How to delete files or folders which cannot be deleted”

  • 1
    albina elvira on September 6, 2016 Reply

    The path you entered, is too long. Enter a shorter path
    File Name could not be found. Check the spelling of the filename,
    and verify that the file location is correct.

Leave a Reply

Your email address will not be published. Required fields are marked *