New
#11
Here's what happened.
Windows uses desktop.ini files to customize folders. Windows uses these not only to assign custom icons to file system folders, but also language-specific display names (LocalizedResourceName
). The file for Documents looks like this:
The various language versions have different shell.dll files. So when Explorer queries:Code:[.ShellClassInfo] LocalizedResourceName=@%SystemRoot%\system32\shell32.dll,-21770 IconResource=%SystemRoot%\system32\imageres.dll,-112 IconFile=%SystemRoot%\system32\shell32.dll IconIndex=-235 [ViewState] Mode= Vid= FolderType=Documents
- @%SystemRoot%\system32\shell32.dll,-21770
- An English language version returns: Documents
- A Hungarian(?) language version returns: Dokumentumok
WHen you re-driect a KnownFolder, Explorer creates the file in the new target.Things can get confusing when more than one folder in the same location has the sameLocalizedResourceName
. For example, if I create a folder named3D Redirect
under my UserProfile, before re-direction, things appear normal:
If I then re-direct 3D Objects to it (without moving contents so original folder remains), my UserProfile folder now looks like this in Explorer:
and the actual folder names are only revealed outside of the Explorer shell:
And when a folder has aCode:PS C:\...\keith>gci 3D* Directory: C:\Users\keithMode LastWriteTime Length Name ---- ------------- ------ ---- d-r--- 4/17/2021 11:48 PM 3D Objects d-r--- 4/17/2021 11:54 PM 3D ReDirectLocalizedResourceName
applied, re-naming the folder in Explorer
doesn't rename the file system folder, it only modifies the desktop.ini file, assigning a literal value toLocalizedResourceName
:
Code:PS C:\...\keith> gci 3D* Directory: C:\Users\keithMode LastWriteTime Length Name ---- ------------- ------ ---- d-r--- 4/17/2021 11:48 PM 3D Objects d-r--- 4/18/2021 12:23 AM 3D ReDirect PS C:\...\keith>sl '.\3D ReDirect\' PS C:\...\3D ReDirect>gc desktop.ini [.ShellClassInfo] LocalizedResourceName=3D Objects ReName IconResource=%SystemRoot%\system32\imageres.dll,-198
Windows also tries to "protect" these folders by restoring the desktop.ini file if it's been deleted or modifed. So when you had both Documents & Downloads pointed to the same folder, you had dueling desktop.ini files changing the display name back & forth.
As for the folders that appear under This PC, there are two KnownFolders that reference the user's Documents, Downloads, Music, Pictures, and Videos folders:
FolderDescriptions are in the registry under:Code:FolderDescriptionID Name InstanceCLSID ------------------- ---- ------------- {0ddd015d-b06c-45d5-8c4c-f59713854639} Local Pictures {24ad3ad4-a569-4530-98e1-ab02f9417aa8} {18989B1D-99B5-455B-841C-AB7C74E4DDFC} My Video {A0953C92-50DC-43BF-BE83-3742FED03C9C} {33E28130-4E1E-4676-835A-98395C3BC3BB} My Pictures {3ADD1653-EB32-4CB0-BBD7-DFA0ABB5ACCA} {35286a68-3c57-41a1-bbb1-0eae73d76c95} Local Videos {f86fa3ab-70d2-4fc7-9c99-fcbf05467f3a} {374DE290-123F-4565-9164-39C4925E467B} Downloads {374DE290-123F-4565-9164-39C4925E467B} {4BD8D571-6D19-48D3-BE97-422220080E43} My Music {1CF1260C-4DD0-4EBB-811F-33C572699FDE} {7d83ee9b-2244-4e70-b1f5-5393042af1e4} Local Downloads {088e3905-0323-4b02-9826-5d99428e115f} {a0c69a99-21c8-4671-8703-7934162fcf1d} Local Music {3dfdf296-dbec-4fb4-81d1-6a3438bcf4de} {f42ee2d3-909f-4907-8871-4c22fc0bf756} Local Documents {d3162b92-9365-467a-956b-92703aca08af} {FDD39AD0-238F-46AF-ADB4-6C85480369C7} Personal {A8CDFF1C-4878-43be-B5FD-F8091C1C60D0}
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions
and the InstaceCLSIDs are found under:
HKCR\CLSID
and all are added to the This PC folder by their Instance CLSID:
But only the "Local..." versions are visible. The others are hidden by the "ThisPCPolicy" value found in the PropertyBag subkey of the FolderDescriptionID.Under the User Shell Folders key, some KnownFolders are referred to by their name and some by their InstanceCLSID.For a newly-creaetd user, only Personal, My..., and {374DE290-123F-4565-9164-39C4925E467B}(Downloads) are defined. It's only when you re-direct the folders that their "twin" "Local..." IDs are created.
So when you changed the path for Personal, you saw no chnage under This PC, because the visible Documents was using the path defined for {d3162b92-9365-467a-956b-92703aca08af} (Local Documents). Had you explicitly typedshell:Personal
in the Explorer Address bar, it would have opened to your edited path.
But the "trick" I mentioned in my earlier post does appear to still work. While the default behavior of the shortcuts is to use the display name of the target folder, this can be over-ridden by creating entries under:
HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CLSID
So, the following.reg
file would ensure that the shortcuts always display their default names and icons under This PC, even when re-directed to the same folder:
Code:Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CLSID] [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CLSID\{088e3905-0323-4b02-9826-5d99428e115f}] @="Downloads" [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CLSID\{088e3905-0323-4b02-9826-5d99428e115f}\DefaultIcon] @="C:\\WINDOWS\\system32\\imageres.dll,-184" [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CLSID\{374DE290-123F-4565-9164-39C4925E467B}] @="Downloads" [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CLSID\{374DE290-123F-4565-9164-39C4925E467B}\DefaultIcon] @="C:\\WINDOWS\\system32\\imageres.dll,-184" [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CLSID\{A8CDFF1C-4878-43be-B5FD-F8091C1C60D0}] @="Documents" [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CLSID\{A8CDFF1C-4878-43be-B5FD-F8091C1C60D0}\DefaultIcon] @="C:\\WINDOWS\\system32\\imageres.dll,-112" [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CLSID\{d3162b92-9365-467a-956b-92703aca08af}] @="Documents" [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CLSID\{d3162b92-9365-467a-956b-92703aca08af}\DefaultIcon] @="C:\\WINDOWS\\system32\\imageres.dll,-112"
With that you can redirect the folders to a common folder and they will still appear unique under This PC. After re-directing, you can clear the Read-only attribute on the target folder to ensure it displays with its file system name.