1

This is curious, some startmenu items seems to resolve to a "friendly" name that's not contained in the actual .lnk file. For example:

"c:\ProgramData\Microsoft\Windows\Start Menu\Programs\Accessories\System Tools\dfrgui.lnk" is displayed in explorer as "Disk Defragmenter", the actual shortcut file doesn't contain the real name either but links to the exe "C:\Windows\system32\dfrgui.exe""

Is this a Win32 API thing or is there a simpler way to get the "friendly" name of a file/start menu item?

Homde
  • 4,246
  • 4
  • 34
  • 50
  • What version of Windows are you using? I checked with XP and seems that that the display name is taken from the name of the `.lnk` file. For Disk Defragmenter it's actually called `Disk Defragmenter.lnk` on XP. – detunized Dec 05 '10 at 14:18

1 Answers1

5

There's a hidden file in that folder named desktop.ini. This is the content on my machine:

[.ShellClassInfo]
LocalizedResourceName=@%SystemRoot%\system32\shell32.dll,-21788
[LocalizedFileNames]
System Information.lnk=@%systemroot%\system32\msinfo32.exe,-100
Resource Monitor.lnk=@%SystemRoot%\system32\wdc.dll,-10030
dfrgui.lnk=@%systemroot%\system32\dfrgui.exe,-103
Task Scheduler.lnk=@%SystemRoot%\system32\miguiresource.dll,-201
System Restore.lnk=@%systemroot%\system32\rstrui.exe,-100
Disk Cleanup.lnk=@%SystemRoot%\system32\shell32.dll,-22026
Character Map.lnk=@%SystemRoot%\system32\shell32.dll,-22021
Windows Easy Transfer.lnk=@%windir%\system32\migwiz\wet.dll,-588
Windows Easy Transfer Reports.lnk=@%windir%\system32\migwiz\wet.dll,-591

This is the relevant line:

dfrgui.lnk=@%systemroot%\system32\dfrgui.exe,-103

The -103 value indicates the string is read from string resource #103 in dfrgui.exe. In Visual Studio, I used File + Open + File, selecting c:\windows\system32\dfrgui.exe. Opened "String table" and double-clicked it:

Shows string table content

This may well be different on your machine, depending on where you live. What I showed is for the English version of Win7.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536