Windows 7: Uncooperative Icons in System Tray

I had a program, GoodSync, that I used regularly.  For some reason, its icon stopped appearing in the system tray (i.e., the area that appears to be recessed, at the bottom right corner of the screen in Windows 7).  This post describes some steps I took to fix that.

I went into the dialog that allowed me to customize system tray icons.  One way to get there was to right-click somewhere along the edges of the system tray and choose Properties.  If I did that in the right place, this would open the System Icons dialog, which would contain a “Customize notificaiton icons” option.  That option would open up the Notification Area Icons dialog.  Another way to get there was to right click on the double up-angle character (if there was one) at the left end of the system tray.  There was also a Notification Area Icons option in Control Panel.

Once I was in the Notification Area Icons dialog, I saw that I was mistaken.  GoodSync was still appearing in the system tray, but it was being represented by the wrong icon.  Instead of its customary orange globe, the icon next to GoodSync in that dialog was the pennant that normally represented “Solve PC Issues” in the system tray.  My icons were mixed up.  Or at least this one was.

A search led to various suggestions.  One was to “find a startup manager to control the loading of the various services and programs that display a tray icon.”  Another was to rebuild the icon cache.  Since I saw the latter suggestion in several places, I decided to start with that.

There seemed to be several different approaches to rebuilding the icon cache.  A Windows SevenForums webpage said that I could download and run a batch file containing these commands:

:: Created by: Shawn Brink
:: Tutorial:
@echo off
echo The Explorer process must be killed to delete the Icon DB.
echo Please SAVE ALL OPEN WORK before continuing.
taskkill /IM explorer.exe /F
echo Attempting to delete Icon DB...
If exist %userprofile%\AppData\Local\IconCache.db goto delID
echo Icon DB has already been deleted.
goto main
cd /d %userprofile%\AppData\Local
del IconCache.db /a
echo Icon DB has been successfully deleted.
echo Windows 7 must be restarted to rebuild the Icon DB.
set /p choice=Restart now? (Y/N) and press Enter:
If %choice% == y goto Yes
If %choice% == Y goto Yes
If %choice% == n goto No
If %choice% == N goto No
goto wrong
shutdown /R /f /t 00
echo Restart aborted. Please remember to restart the computer later.
echo You can now close this command prompt window.

If that didn’t work, the Windows SevenForums webpage advised taking the additional step of running a REG file related to ICO files (found on another webpage).  That REG file read as follows:

Windows Registry Editor Version 5.00

"Content Type"="image/x-icon"

Alternately, the Windows SevenForums webpage suggested closing other work in progress and running these commands in a CMD window:

taskkill /IM explorer.exe /F
CD /d %userprofile%\AppData\Local
DEL IconCache.db /a
shutdown /r /f /t 00

Here, again, they said it might be necessary to run the ICO REG file (above) if those steps, by themselves, did not fix the problem.  Another webpage offered a different batch file, without the REG file add-on:

rem Try to close explorer.exe ...
taskkill /f /im explorer.exe
rem Clear the system icon cache DB ...
attrib -h -s -r "%userprofile%\AppData\Local\IconCache.db"
del /f "%userprofile%\AppData\Local\IconCache.db"
attrib /s /d -h -s -r "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\*"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_32.db"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_96.db"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_102.db"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_256.db"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_1024.db"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_idx.db"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_sr.db"
rem Clear the system tray icon cache
echo y|reg delete "HKEY_CLASSES_ROOT\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify" /v IconStreams
echo y|reg delete "HKEY_CLASSES_ROOT\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify" /v PastIconsStream
rem Start the explorer.exe
start explorer

Another webpage offered links to a Notification Area Cleaner program (intended to remove obsolete icons from the system tray) and also to a Rebuild Icon Cache tool and a guide to manually rebuild the icon cache.  The author of the rebuilding tool admitted that this was his/her “first self-written program.”  The manual rebuilding guide advised me to go into Windows Explorer (Tools > Folder Options > View tab) to Show Hidden Files, and then go to C:\Users\[username]\AppData\Local and delete IconCache.db, and then reboot.  The search (above) turned up other solutions as well (e.g., installing and then uninstalling EnhanceMySe7en to restore the ability to customize icons and notifications).  But I believed I probably had enough to work with for now.

I decided to start with the Windows SevenForums batch file, called Rebuild_Icon_Cache.bat.  It warned me to save my open work before continuing.  I did that and then went ahead.  This solved the problem.  Whatever the complications that might have arisen in other cases, in my case it appeared (an hour or two after running the batch file) that the solution was actually very simple.

This entry was posted in Uncategorized and tagged , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s