Another Windows 11 Fix for the Intermittent and Annoying Missing, Empty, Blank Taskbar Icons
Over the last few years, as I’ve continued to test various Hypervisors in my home lab, I have noticed that occasionally there are very quirky things that might happen to a Windows 11 Desktop while running in a VM as a Guest OS. This seems to be more common with ProxMox and Xen-based Hypervisors, but perhaps that’s only because I favor those for running Windows Guests VMs. That said, I used to see this issue on Bare Metal installs of Windows, too, before 2023. As this issue seems to pop up once a year or so, across ~100-ish Windows 11 Desktops I touch per year, I have explored a lot of various tools for cleaning caches, file system repairs, etc with varying levels of success (and time spent).
TL;DR – Click here to skip to the PowerShell One Liner to Fix Missing Taskbar Icons in Windows 11
Since this issue isn’t necessarily a total showstopper, it often goes neglected or ignored, until I feel like I “need” the taskbar icons back. Each year, the goalposts seem to move a bit, as often the same fix I used last time will no longer work after a few years pass. Some fixes, however, work most of the the time and tend to be timeless. So here are most solid methods that seem to work most consistently for restoring the missing taskbar icons:
The PowerShell, Command Prompt and copy/paste one-liner scripts below are effectively just a simple and streamlined way to apply multiple fixes all-in-one shot for “Restarting Windows Explorer”, “Rebuilding Windows Icon Cache”, “Deleting the Iris Service from Windows” and the sometimes useful “Proper Windows Shutdown” (shutdown -r -t 0
) helps solves all kinds of strange, buggy issues with not just the GUI, but also background services and programs not opening and closing properly, too.
- In all cases below, use “As Administrator”, or else you won’t be able to perform all of the necessary actions.
- If you are using the below PowerShell options, you will need to change the Execution Policy from ‘Restricted’ to ‘RemoteSigned’, and then be sure to set it back to ‘Restricted’ (or whatever you want it to be) after your reboots.
PowerShell One Liner: Fix Missing Taskbar Icons In Windows 11
Here is the quick and dirty; I’ve combined everything into a single one-liner for PowerShell (v5+) for you to copy/paste:
1 2 |
#PowerShell One-Liner to Fix Windows 11 Missing Icons in Taskbar (New-Object -ComObject Shell.Application).Windows() | %{$_.quit()} ; Start-Sleep -Seconds 3 ; del $env:USERPROFILE\AppData\Local\Microsoft\Windows\Explorer\*cache* ; reg delete HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\IrisService /f ; shutdown -r -t 0 ; |
Command Prompt One-Liner
If you want to just copy/paste, do so by using the below last line from a Command Prompt – *NOT* PowerShell
– To get to a Command Prompt from PowerShell, type cmd.exe
and Press [Enter/Return] first to show a Command Prompt terminal.
– You can also type cmd.exe
in the Run… box (WindowsKey + R), but be sure you used the “As Administrator” options.
1 2 |
#Command Prompt (cmd.exe) One-liner cmd /c "taskkill /f /im explorer.exe" && del "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\*cache*" && reg delete HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\IrisService /f && shutdown -r -t 0 |
PowerShell Script (for Reusability and Remote Scripting)
If you would like to save my PowerShell script to use later or for multiple systems management, should this issue be happening a few times a year or on multiple systems, please save it as: fix-win11-missing-taskbar-icons.ps1
For PowerShell v5 or higher:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
<# .SYNOPSIS Fix missing Taskbar Icons in Windows 11 (WILL TRIGGER A REBOOT) .DESCRIPTION This PowerShell script does the following: - Closes the Microsoft File Explorer application gracefully, - Deletes stale *cache* files from USERPROFILE\AppData\Local\Microsoft\Windows\Explorer\, - Deletes the Iris Service (which gets auto reinstalled after reboot) - Performs a proper Windows Restart. - Taskbar icons should be restored after reboot. For security considerations: - If you execute this script as shown in the example, below, you may have to toggle your local machine settings first, to 'Set-ExecutionPolicy RemoteSigned', then run the script, and then set back to 'Set-ExecutionPolicy Restricted' (or whatever you prefer) after the reboot is complete .EXAMPLE PS> ./fix-win11-missing-taskbar-icons.ps1 .LINK https://t.ly/rU3E9 .NOTES Author: Justin Merrill | License: CC0 #> #Close Open Windows Explorer Windows first... (New-Object -ComObject Shell.Application).Windows() | %{$_.quit()} # Wait for them all to close Start-Sleep -Seconds 3 # Delete the files that contain stale *cache* from the USERPROFILE Windows Explorer configuration del $env:USERPROFILE\AppData\Local\Microsoft\Windows\Explorer\*cache* # Delete/Remove the Iris Service reg delete HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\IrisService /f # Prompt the user before the reboot Read-Host -Prompt "Icon Cache has been cleared and the Iris Service removed. Press Enter to reboot immediately to apply the fix, or CTRL+C to reboot later." # Do a proper Windows Restart/Reboot by shutting down and then rebooting shutdown -r -t 0 exit 0 # success |
Windows Batch file (for Reusability and Scripting)
If instead of the PowerShell script (see above) you would like to save my Windows batch file script (.bat) to use later or for multiple systems management, please save it as: fix-win11-missing-taskbar-icons.bat
For Windows Batch File, which you can execute with a double click or from the cmd.exe prompt, save the file as: fix-win11-missing-taskbar-icons.bat
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
@ECHO OFF :: Fix for missing / blank / empty Windows 11 Desktop Taskbar Icons TITLE Fix missing Windows 11 Desktop Taskbar Icons - JustinMerrill.com ECHO Filename: fix-win11-missing-taskbar-icons.bat ECHO URL: https://t.ly/rU3E9 ; Author: Justin Merrill ; License: CC0 ECHO Here are the commands (in one-liner format) That will be executed with this script: ECHO "'cmd /c "taskkill /f /im explorer.exe" && del "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\*cache*" && reg delete HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\IrisService /f && shutdown -r -t 0'" ECHO ========== ECHO Close any open Windows Explorer Windows: cmd /c "taskkill /f /im explorer.exe cmd /c "taskkill /f /im explorer.exe" ECHO ========== ECHO Delete corrupt files of your user profile with the missing taskbar icons: del "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\iconcache*" del "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\*cache*" ECHO ========== ECHO Delete the Iris Service (Which gets auto reinstalled after reboot): reg delete HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\IrisService /f reg delete HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\IrisService /f ECHO ========== ECHO Icon Cache has been cleared and the Iris Service removed. ECHO We then do a proper Windows reboot with: shutdown -r -t 0 ECHO ========== ECHO Do you want to reboot immediately to apply the fix (Y)? or wait until later to reboot (N)? ECHO ========== ECHO (Y - reboot immediately / N - wait to reboot and restore Windows Explorer) SET /P rebootnow= (Y/N)? :: Nested if Statement for missing "OR Logic" from Windows batch scripting :: - 'Y' or 'y' reboots, any other keys restarts explorer.exe if "%rebootnow%"=="Y" ( shutdown -r -t 0 if "%rebootnow%"=="y" ( shutdown -r -t 0 ) ) else ( start explorer.exe ) |
Sources and References:
- Other possible fixes for your issue: https://www.howtogeek.com/fix-hidden-taskbar-icons-windows-11/
- https://superuser.com/questions/851610/how-to-convert-bat-to-ps1-to-fix-scripts-not-running-in-task-scheduler
- https://github.com/fleschutz/PowerShell/blob/main/scripts/close-file-explorer.ps1
- https://superuser.com/questions/612409/how-do-i-run-multiple-commands-on-one-line-in-powershell
- https://lazyadmin.nl/powershell/run-a-powershell-script/
- https://stackoverflow.com/questions/1223721/in-windows-cmd-how-do-i-prompt-for-user-input-and-use-the-result-in-another-com
- https://stackoverflow.com/questions/5591491/conditional-statements-in-batch-files
- https://www.windowscentral.com/software-apps/windows-11/how-to-create-batch-script-files-on-windows-11
- https://softwareengineering.stackexchange.com/questions/329178/windows-batch-files-bat-coding-style-standard
- https://stackoverflow.com/questions/5237723/how-do-i-get-help-messages-to-appear-for-my-powershell-script-parameters