The information about pinned items on the Start screen and the Taskbar are stored in the following keys:
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist\{...}\Count
and
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\TaskBand
Unfortunately, all the key values are encrypted binary blobs so you can't edit them directly. Furthermore, there is no group policy that controls it. Microsoft did this deliberately to discourage app vendors from pinning their crapware in your face. I find this excuse laughable, since it doesn't stop shady programmers from behaving badly at all, but does make it a pain for you to carry out a legitimate administrative function.
Modifying the task bar programmatically requires you to write a script that simulates a right-click of the item on the Start Menu and hitting "Pin/Unpin from Taskbar" like so:
Dim objShellApp
Dim objWMI
Dim objVerb
Dim objScreen
Dim objProcess
Dim colVerbs
Dim colScreens
Dim colProcesses
Set objFS = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("WScript.Shell")
Set objShellApp = CreateObject("Shell.Application")
Set objWMI = GetObject("winmgmts:\\.\root\CIMV2")
'Remove Windows Media Player from Taskbar
If objFS.FileExists(objShell.SpecialFolders("AllUsersPrograms") & "\Windows Media Player.lnk") Then
Set colVerbs = objShellApp.Namespace(objShell.SpecialFolders("AllUsersPrograms")).ParseName("Windows Media Player.lnk").Verbs
For Each objVerb in colVerbs
If objVerb.Name = "Unpin from Tas&kbar" Then
objVerb.DoIt
Exit For
End If
Next
End If
'Add Microsoft Outlook to Taskbar
If objFS.FileExists(objShell.SpecialFolders("AllUsersPrograms") & "\Microsoft Office\Microsoft Outlook 2010.lnk") Then
Set colVerbs = objShellApp.Namespace(objShell.SpecialFolders("AllUsersPrograms") & "\Microsoft Office").ParseName("Microsoft Outlook 2010.lnk").Verbs
For Each objVerb in colVerbs
If objVerb.Name = "Pin to Tas&kbar" Then
objVerb.DoIt
Exit For
End If
Next
End If
Modify the script for whatever items you want pinned/unpinned. You'll need this script to run in the context of each user's logon. You can't do it in bulk. Therefore, you'll have to dump this script into the RunOnce registry key in each user's registry hive.
Or, you could add a line at the end of the script file to have it commit suicide when it's done and place it in the Startup folder of every user (including the default user so it applies when new users sign in).
objFS.DeleteFile WScript.ScriptFullName
Either way, you do not want to put it in the All Users profile. You need to ensure that it runs only once for each person in their own user context and never run it again (lest it destroy their customizations).
Thanks for the in depth answer & the script. Very annoying workaround due to the Encryption. Hopefully some other way comes up, although I doubt it. – RogerPassfield – 2015-04-23T01:14:09.517