Great question! Here’s how Windows assigns icons to all those shortcuts:
How Windows Shortcuts Get Their Icons
- System Folders/Shell Shortcuts:
If you use explorer.exe shell:SomeSpecialFolder
, Windows assigns the correct icon as seen in Explorer and the Start menu. E.g., This PC
, Control Panel
, and Network
get their special system icons.
- Regular Folders:
Shortcut points directly to a folder (e.g., C:\Users\Tim\Documents
) → plain yellow folder with shortcut arrow.
- .exe and .msc Files:
If you point to an .exe
(e.g., Task Manager, Notepad), Windows uses the program’s embedded icon. If you point to a .msc
(e.g., Device Manager), Windows picks the default MMC icon (unless a specific icon is registered).
- Shell Verb Shortcuts:
Opening a shortcut with, say, explorer.exe shell:MyComputerFolder
(vs. hard path to "This PC") always produces the "real" This PC icon.
How to Script with the "Right" Icons
The
PowerShell script I gave earlier uses
explorer.exe shell:{Verb}
for system icons and links directly to
.exe
or
.msc
for admin tools:
- This guarantees the correct system icon is shown for each special folder or tool.
- You don’t need to manually set icon paths: Windows does that based on the shortcut target, if you use the shell verbs or correct executable locations.
If you want to customize icons:
You can specify an alternate icon for any shortcut in your script, for example:
$shortcut.IconLocation = "$env:SystemRoot\System32\shell32.dll,3"
…but for almost all Windows tools and shell folders,
the default icon is correct.
Where Are the Actual Icons Stored?
- Most system shell icons:
%SystemRoot%\System32\imageres.dll
%SystemRoot%\System32\shell32.dll
- Program icons:
embedded in the program (.exe
or .msc
file) itself.
- Shortcuts to folders are shown as plain folders by default.
Location Examples
Shortcut Target Type | Example Target/Arguments | Default Icon Location |
---|
This PC (Computer) | explorer.exe shell:MyComputerFolder | System draws correct icon |
Control Panel | explorer.exe shell:ControlPanelFolder | System draws correct icon |
Recycle Bin | explorer.exe shell:RecycleBinFolder | System draws correct icon |
Documents Folder | explorer.exe shellersonal | System draws correct folder icon |
User’s Files | explorer.exe shell:UsersFilesFolder | System draws correct generic user folder icon |
Device Manager (Admin tool) | %SystemRoot%\System32\devmgmt.msc | From devmgmt.msc or MMC shell |
Task Manager | %SystemRoot%\System32\taskmgr.exe | From taskmgr.exe |
Notepad | %SystemRoot%\System32\notepad.exe | From notepad.exe |
Music/Pictures/Videos/Gallery | explorer.exe shell:MyMusic/MyPictures/MyVideo | System draws correct folder icon |
Best Practice for Accurate Icon Assignment
- For special folders and system icons:
Use shell verbs (explorer.exe shell:...
) in your shortcut generator script (as demonstrated above).
- For apps/tools/utilities:
Link directly to the program’s .exe
or .msc
—Windows will use the “real” program icon.
Customizing Icon (optional)
If you ever want to override and use a custom icon, set this property in your PowerShell script after
.TargetPath
:
Code:
$shortcut.IconLocation = "C:\Path\To\YourIcon.ico"
$shortcut.Save()
…but this is not usually needed for standard Windows items.
If you notice any icon showing up as a plain folder when you expect the Windows icon, switch that shortcut to use a shell:
verb if available, or confirm you’re linking to the correct file.
If you want a script for
Dutch-language shortcut names or mapped 1:1 to your screenshot
with no duplicates and perfect icons, just let me know!