Windows explorer sees different file name from cmd

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

  • Microsoft corporation (2011-06-28). You cannot view or change the Read-only or the System attributes of folders in Windows Server 2003, in Windows XP, in Windows Vista or in Windows 7. ID 326549. Microsoft KnowledgeBase.
  • Microsoft corporation (2011). Customizing Folders with Desktop.ini. MSDN.

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.