How to properly refresh the Windows desktop and start menu

Issue

Occasionally the Windows desktop, either natively or inside a Citrix desktop is not rendered properly and some desktop or start menu items are missing or not shown properly.

Solution

As per the article at https://blog.barthe.ph/2010/02/23/force-desktop-refresh/, it appears that simply using the F5 shortcut inside a Windows desktop is not enough to properly refresh the desktop (and associated start menu items). This is because a certain system call needs to be invoked via the Windows API. The required API function which must be implemented is the following:

SHChangeNotify (SHCNE_ASSOCCHANGED, 0, 0, 0)

The above solution can be implemented programmatically via any applicable programming language such as C# and then compiled into a native Windows executable (exe). This has already been implemented by Helge Klein and the .exe is available for download at https://helgeklein.com/blog/2007/11/free-tool-refresh-the-desktop-programmatically/ .

The above tool can be used for properly refreshing the windows desktop and associated items in Start menu. On top of this tool we also need a process to properly refresh the Windows 10 desktop. This comprises two parts: Firstly the invocation of the following cmdlet:

Get-Process 'shellexperiencehost' | Stop-Process -Force

As per https://superuser.com/questions/1322631/how-to-create-a-real-time-refresh-of-windows-10-start-menu the above command preserves the taskbar, the desktop, open Explorer windows, and hosted Explorer views, but the Start menu is reinitialized when that process automatically restarts.

For the start menu also what is also needed is the copy of all relevant start menu folders and files to to “%AppData%\Microsoft\Windows\Start Menu\Programs” and the configuration of the LayoutModification.xml file. The LayoutModification.xml file is set for each user by utilizing the following Group Policy: User policies -> Administrative templates -> Start menu and taskbar -> start layout -> Start Layout File.

You can find more detailed guidance and step-by-step procedures for analyzing and troubleshooting Citrix Virtual Apps and Desktops organized by category in my Citrix Virtual Apps and Desktops Troubleshooting e-book.

Was this article helpful?

Related Articles