"Sorry, I'm stupid. I don't know how to delete files with a long filename. Why don't you erase me and replace me with Linux?"I may have applied my editorial powers on the error message above, but the gist of it was that the pathname was too long for Windows 7's NTFS file system. Windows 7 refused to permit any deletion of the files, no matter which variant of del or rmdir I tried. As a last resort, I tried renaming the files to conform to Windows 7's inexplicable rule. Windows 7 refused to let me rename them. I googled for help, because Windows 7 is no help. Based upon suggestions on a microsoft forum, for about half an hour I tried variations of the rm, rmdir, del, and even the cacls commands, to no avail.
This is one of the worst bugs I have ever encountered in Windows, and it was not present in Windows XP, because the files with the too-long pathnames came from a Windows XP computer! Windows has just gotten buggier, not better. The only thing Microsoft thinks about is how to enhance profits. The end user experience is the last thing on its mind.
But I've got a new feather in my cap since 2012. I'm a Linux veteran. I wouldn't call myself a guru other than in jest, but I know my way around a Linux system and can create and execute shell scripts, upgrade the kernel, and modify system parameters without too much difficulty, and I'm learning new things all the time. Let me say this to the Windows diehards: Linux is very useful, and you should learn it because it will help you manage your Windows system. Today is a case in point. I had a funny feeling that the Windows bug would not exist in Linux. Linux can read a Windows drive without any difficulty. Of course, Windows cannot read Linux drives, because of its severe limitations in intellectual capacity.
I insert a CD of Gparted, the Linux distro with a funny name, and boot my system from the CD, accepting all the defaults along the way. I love Gparted. Its mission in life is to repartition drives, and it can handle just about any type of drive. I have used it for its intended purpose many a time, but today I wish to use it for an unintended purpose. The command line is what I want. A Linux command prompt is a powerful thing, let me tell you, about a hundred times more powerful than a Windows command prompt.
By default, Gparted boots into a minimalist graphical environment and loads the flagship program, Gparted, which after a few moments reveals the pathnames of the attached drives. This is important information that I will use to compose the commands below. I wait until Gparted has gathered its information, which takes about a minute, and then click on a different program, the Terminal icon, which gives the command prompt.
Do not fear the Linux command prompt. It is your friend. It will let you do what you want to do, unlike Windows. What I want to do is kill the files that Windows won't kill because Windows is stupid. The first step is to mount the Windows drive into the Linux file hierarchy. I prepare for this by creating a directory that will be used to mount the NTFS drive:
sudo mkdir /mnt/windozeThen I take the information observed from the Gparted window, which reveals the name of the drive, /dev/sdsomething-or-other, and compose a command resembling this:
sudo mount /dev/sda2 /mnt/windozeNote that /dev/sda2 isn't necessarily going to be the case on your computer, and /mnt/windoze is simply a name I made up, although it is quite proper to mount drives in the /mnt directory.
What's left is to navigate to the directory with the bad file and kill it.
cd /mnt/windozeNote that ls is the rough equivalent of dir in the Windows command line. I enter several more cd commands. Once I find the directory or the files that I want to delete, I use a very powerful command, rm, which I suggest examining prior to using. To get some help on a Linux command, one enters the command followed by --help. Try
rm --helpThe command that finally gets rid of the bad filenames, which exist in a folder called "documentaries", is
sudo rm documentaries --recursiveAnd that's that! No more immortal files lingering on my Windows filesystem. I clicked on Exit, and Gparted let me reboot the system back into Windows, where I confirmed that the files were indeed gone.