Windows explorer sees different file name from cmd

16

1

I just got a new computer, and put my old hard drive (which contained Windows) in the new computer to keep my old files. I was successfully able to remove the Windows directory from this drive, but I'm having some trouble here. I am using Windows 7.
Basically Windows Explorer seems to see different file names compared to cmd. And the file names seen in windows explorer don't actually work (i.e. if I try to install something to a folder, it has to be installed to the foldername shown in cmd). The only way to rename them properly, is through cmd, but even then Windows Explorer doesn't see the change.

What is going on here? And how can I fix it?

Hosh Sadiq

Posted 2012-01-22T09:50:04.777

Reputation: 293

Answers

19

Windows Explorer isn't the old DOS+Windows File Manager. Folders are not directories.

Given the marked difference between the Recycle Bin as it exists in the filesystem and how it looks in Explorer, it's surprising how often people have to be reminded of this fact. Folders are not directories. Explorer doesn't show an unadulterated view of what's in one's filesystem. Rather, directories are (one of) the underlying storage system(s) for what Explorer shows as a folder.

This is not solely the case for special folders and virtual folders, either, as is again surprisingly widely believed. Whenever a directory is marked with the read-only attribute, Explorer displays it according to what's specified in the desktop.ini file in that directory. The desktop.ini tells Explorer what kind of folder the directory holds the backing storage for.

One of the most basic things that desktop.ini tells Explorer is what the name of the folder is. It does this through the LocalizedResourceName value in the .ShellClassInfo key in the desktop.ini file, which provides the number of the name to use in a table built into a DLL. Your old \Program Files (x86)\desktop.ini contains such a name.

Delete, rename, edit, or otherwise adjust the desktop.ini files in these old directories.

Further reading

JdeBP

Posted 2012-01-22T09:50:04.777

Reputation: 23 855

Turns out this feature makes it easy to give the illusion of multiple sub-directories with the same name – Drew McGowen – 2017-06-15T20:22:07.323

Totally forgot about this question, this turned out to be correct, and it seemed that it wouldn't change the name properly because the user in the old Windows installation "owned" those files, so installed the "take ownership" in right click functionality, and used it and could rename them fine! :) Thank you very much! – Hosh Sadiq – 2012-02-10T16:28:28.700

0

One clarification, in case anybody else makes the same mistake I did: the particular desktop.ini you want is the one directly within the folder, rather than the one in that one's parent. I had assumed the latter because typically that's where the name of each child item would be stored, including those of its subfolders. But this is clearly not the case.

But as far as I can tell, my initial mistake had no observable consequences except that the wrongly-inferred name remained wrong.

My thanks to JdeBP for his help.

Alastair Milne

Posted 2012-01-22T09:50:04.777

Reputation: 1