Workarounds, cheat codes, and occasional black magic

Prevent Items Pinning to the Taskbar (Explorer Included)

A couple of years ago, I wrote a post about preventing Internet Explorer and Media Player from pinning to the taskbar. It was a fairly simple solution, and the post continues to generate traffic to this site. Unfortunately, though, the methodology died with the Windows 7 era, and none of the advice even applies anymore. I considered updating that post with this new information, but decided this would better serve.

This method is, unfortunately, a bit more intrusive. It does, however, have the advantage of actually working. It will suffice not only for IE and Media Player, but Explorer.exe as well. My old post might work better for you if you’re on an older Windows. Should those steps fail you, though: these will not.

Explanation:

First, some background and a disclaimer. It is somewhat disingenuous to say we will prevent IE and company from pinning. In point of fact, we will simply be removing the icons as they are pinned, such that the user never sees them. I regret that, since 2008R2, I’ve never found a way to truly prevent them from pinning. Since then, I believe it’s been hardcoded into Windows itself, and no amount of registry, file system, or profile manipulation will get around that. I would absolutely love to be proven wrong on this point. In the meantime, though:

If you’ve done any troubleshooting on this front, you may have found that Windows treats taskbar pins somewhat strangely. It stores a .lnk file in the user profile folder, but deleting the file doesn’t remove the icon from the taskbar–it just breaks the shortcut. You may also have found the registry change at HKCU/Software/Microsoft/Windows/CurrentVersion/Explorer/Taskband. But of course, clearing that out doesn’t quite work either. And, for some reason, neither does getting rid of them both simultaneously. ¯\_(ツ)_/¯

The Resolution:

This leaves us with one option–verbs. Effectively, these are what you’re seeing whenever you right click an item. VBscript allows us to access these programmatically, and the endgame here is going to be a script at login that waits for the items to appear, then “right-clicks” and chooses to “Unpin from taskbar.” Simple enough, except for explorer.exe, which I’ll touch on afterwards. The script below is simplified (and modified) from the excellent work of the Spiceworks user ryadical, who even includes a function to pin new items as well.

The script above, if set to run at login, will remove Internet Explorer and Windows Media Player from the taskbar. It will also attempt to remove File Explorer, but depending on your version of Windows, it may fail.

As discussed above, this script will enumerate the actionable “verbs” on a given shortcut; find the one that Unpins it from the taskbar; and invoke it. The problem is that–at least on 2012R2–you may find that right-clicking the explorer icon in your taskbar does not let you unpin it. I have no idea why, but thankfully, the workaround is simple.

If you’re running into that problem, you have one additional step ahead of you. You can manually add the “unpin” verb to the File Explorer shortcut using the following registry tweak in HKEY_CLASSES_ROOT: