Prolabsoft Sysadmin And Education

AutoPin and Workaround

A common task for system administrators is to automatically pin a shortcut to the Windows taskbar.

I built a small (C++, unmanaged code, MIT) tool to automate this some time ago. It's fairly simple to use: you just create a text file full of the paths you want to pin to the taskbar, and another file of the paths you want to unpin. Then you just run this command:
autopin.exe pinfile.txt unpinfile.txt

This bit of code uses ShellExecute to call a verb operation in Windows Explorer. As a result, it is very simple in implementation.

Unfortunately, it does not work on Windows 10. Down the rabbit hole we go.

Windows 10

Microsoft are in an arms race with this type of application on Windows 10. In accordance with their new strategic direction towards user experience, they'de disabled all the verb operations that can be used to pin items to the taskbar. The rationale seems to be that it prevents software installers adding themselves to the taskbar without asking the user, which enhances the layperson's experience by preventing accumulation of taskbar items. That's a pain for sysadmins though.

In a stroke of poetic irony, Nullsoft Scriptable Install System (LGPL) created a workaround for this that allows installers to do exactly what Microsoft are trying to prevent them to do. Their loss is your gain: I've taken that piece of code out of NSIS and created a standalone program (also MIT) that can be used to automate the task on Windows 10.

You can find a working binary here.

This version adds new usage:

workaround.exe pinfile.txt unpinfile.txt

workaround.exe pin whatever.lnk

workaround.exe unpin whatever.lnk

Strategic Implications

The state of affairs where Microsoft are disabling a feature and other developers are literally building tools to re-enable them is not ideal. It's quite likely that eventually MS will disable this workaround, which will then incite other developers to build other workarounds. All you can say is that this works for now -- if an administrator needs to pin or unpin automatically this will currently do it.

Side Note: Deployments

If you're deploying an OS from scratch, there is now an official way to do this. Autopin/Workaround covers situations where you have to pin or unpin items after deployment.

Feel free to email me any time.