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.
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
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
Steps To Follow
- 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.
- Create a Live USB of the Slitaz OS using LiLi USB Creator as shown below in the image Note:-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.
- 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.
- 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.
- 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
- 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.
- 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.
- 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).
Another type Of Undeletable File
There are two things about this file- The file doesn't have a name
- It gives a permission error as shown when deleted or renamed.
PS:-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.
i simply use Long Path Tool For Following Problem
ReplyDelete