One of the simplest ways to refresh the taskbar is to restart the Explorer.exe process. Here's how:
Sometimes, the issue isn't the process but the database. Windows keeps a history of past icons in the Notification Area. "Refreshing" this involves diving into the Registry to clear the IconStreams and PastIconsStream values, forcing Windows to forget old ghost icons and rebuild the cache upon the next login. refresh windows taskbar
But does it work? Usually, it doesn't.