Wacky Folder Problem in Windows 7

One of the folders on my desktop that I keep a mirrored copy of on my network is an iTunes media folder. This guy contains about 80GB of music and video that I'd rather not see vanish when my RAID array breaks, a HDD explodes, or Somali pirates make off with my desktop. After running a command line utility called 'robocopy' regularly to perform this backup across the network, I noticed something strange in the drive where I keep this folder.

[Click to enlarge]

Yep, there are two folders named iTunes there. Try making two folders with the same name in Windows Explorer. Good luck with that.

Reviewing the properties of both of these folders showed that one was about 80GB and the other was just a handful of bytes. It's pretty clear which one was bogus, but attempts to delete it through the file browser were met with "The system cannot find the specified path". Awesome.

Interestingly, drilling down into the bogus folder looked like I was drilling down into the non-bogus folder. It was filled with the same files and folders as the 80GB one. I created a few new files, dragged, and dropped them in. These files simply vanished; they were not in this folder when opened.

I tried all sorts of things, ridiculous things, things that didn't make sense all in an attempt to trick Windows into figuring out where this folder actually was (or was not!). Nothing worked. Renaming the good iTunes folder allowed me to try removing it via the command line, but none of the commands could figure out where this magical unicorn of a folder was. However, once I renamed the good iTunes folder, the contents of the bogus folder changed.

[Click to enlarge]

Inside the folder were two files that I had dropped into this folder earlier, but had disappeared. A folder, MIR, lived in here as well and was also un-deletable. This newly discovered folder, however, links this issue to robocopy. I use the switch /MIR to perform the mirroring of this folder, making this mess likely a leftover turd from robocopy. Presumably it was caused by prematurely terminated one of the backup sessions, but I have yet to repeat it.

After scouring the internets for a solution to this problem over the course of a few days, I finally ran into this thread. All the way at the bottom, a forum member mentioned using the short DOS folder names to wipe out un-deletable folders by using the /x switch for the dir command.

[Click to enlarge]

The bogus folder had a short DOS folder name of ITUNES~1. Armed with this alternate path to the same folder, I ran 'rmdir /s ITUNES~1' and miraculously, it was gone forever. I had the same issue on the remote drive and was able to erase it the same way.

It was suggested that this could be a symbolic link; something I was familiar with in Linux but had no idea even existed in Windows. I looked into this quite a bit, and found that they were treated very similarly to regular files and folders when it comes to removing them. However, what I had going on here wasn't a symbolic link. I created one to see how it would show up.

[Click to enlarge]

The command prompt, even in its seemingly archaic fashion, still knows best. Symbolic links are shown as what they are; what I had before was most definitely not a symbolic link. It was something else entirely. 

So what was it? Maybe it was just a slightly corrupt folder, but I suspect this won't be the last time it happens. And when it does, it's short DOS folder names all the way.