The missing link

Two Windows 11 machines shared a Desktop folder under OneDrive. A couple of the Shortcut files in the folder, valid links to applications, were missing their icons. The problem was fixed by forcing the rebuilding the icon cache.

Rebuilding the icon cache

The rebuilding of the icon cache can be forced, as follows (in PowerShell):

The Stop-Process cmdlet stops a running process. The -Force parameter allows that to happen without prompting for confirmation.

The Remove-Item cmdlet deletes the specified item at parameter position 0 (or specified by the -Path parameter). The -ErrorAction parameter determines how the cmdlet responds to a non-termination error; SilentlyContinue suppresses the error message and continues executing the command. The -Force parameter allows the removal of items that can’t otherwise be changed.

The Start-Process cmdlet starts a process with the specified file of the program that runs in the process at parameter position 0 (or specified by the -FilePath parameter).

A reboot was required to cause $Env:LOCALAPPDATA\IconCache.db to be recreated.