How To Delete An Undeletable File in Windows

How To Delete An Undeletable File in Windows On 13:09 By , , , , , , , In this post I’ll be telling you guys how to delete a file which can’t be deleted or renamed because of an error saying The file name you specified is not valid or too long as shown in the images below.

Requirements

  • An ISO image of Slitaz(42 Mb) which you can download from this link
  • LiLi USB Creator which you can download from this link

First I will tell you the steps to delete the files and then I will tell the reason why this method works.

Steps To Follow

  1. Locate the undeletable files and then write the path on a piece of paper or you can remember the path as we will be needing that later.
  2. Create a Live USB of the Slitaz OS using LiLi USB Creator as shown below in the imageLili USB CreatorNote:-In Step 2 of the LiLi USB Creator Wizard you will see a compatibility issue as shown below so need to worry just ignore that.
  3. Then you have to boot your PC or Laptop from this Live USB you just created.For this, restart your computer and enter into BIOS usually by pressing del, F2 or F10 as it varies from device to device or else you can search for your device on the internet.Change the setting in the boot option so that you can boot from usb.
  4. After you boot from your USB a menu will appear in which you will choose the first option Slitaz Live through arrow keys and then Press Enter.You will then see Slitaz’s Desktop as shown below.
  5. To delete those files you have to go to the path which you noted down in the 1st step.For this, click the spider icon in the upper left corner and then choose PCMan File Manager from the System Tools as shown below
  6. A window will appear in front of you in which on the left sidebar you will see all your partitions like all three partitions of mine are shown in the image below.
  7. Now locate the undeletable files in one of these partitions and then select those files and delete them by pressing Shift + delete(to permanently delete) and this time deletion will work.
  8. Now after deletion you need to reboot your computer but this time boot from your Hard Disk(normal boot) and not from USB.For this just click on the Power Icon in the upper right corner and then choose Reboot system as shown.

Reason Why The Above Method Works

In Windows the file name cannot contain some characters shown below in the image.The Screenshot images we just deleted contained ‘:’ character in its file name so that was the main reason why it was showing us an error when we tried to delete or rename it.

On the other hand in Linux based OS the file names can contain any characters other than

  • a forward slash ( / ), which is reserved for use as the name of the root directory (i.e., the directory that contains all other directories and files) and as a directory separator
  • null character (which is used to terminate segments of text).

Spaces are permitted, although they are best avoided because they can be incompatible with legacy software in some cases.

Another type Of Undeletable File

There are two things about this file

  1. The file doesn’t have a name
  2. It gives a permission error as shown when deleted or renamed.

The method used by me to delete this file was just as described in this post but instead of Slitaz OS I used Ubuntu as shownPS:-The Screenshot images were saved by me when I was running Live Ubuntu on my Laptop.Since then I was not able to delete them in Windows until now.That’s how I figured that if Ubuntu created those files then Ubuntu or any Linux based OS can remove it.