This post has been superseded by the Pin Programs to the Taskbar in Windows 10 with Group Policy article. You can continue reading below for an overview of how pinning works at the OS level. The article below also contains two corny jokes.
The Taskbar in Windows 7 and the Start Screen in Windows 8 are the first places your users should go to access their applications. Unfortunately, users do not take advantage of these locations by pinning programs. Instead, they will cumbersomely search the Start Menu or minimize twelve applications to get to the desktop. It is time to make their life a bit easier!
In part one of this two part series, we will cover pinning programs to the Taskbar with Group Policy. In part 2, we will cover similar tricks for managing the Windows 8 Start Screen. No matter your OS, making applications easier to access will certainly make your staff happier!
How Can I Pin Programs to the Taskbar with Group Policy?
Not as easy as you would think. It can’t be done with Administrative Templates. Though you can use Group Policy Preferences, it isn’t fun or flexible. The best way (so far) seems to be with Group Policy Scripts. Here is the funny thing about programs that are pinned to the Taskbar. They aren’t exactly stored clearly or cleanly.
For an application to show up on the Taskbar, it must have a corresponding shortcut and appear in a specific registry value. The shortcut must exist under the current user’s roaming appdata (%APPDATA%). The exact location is at: %APPDATA%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar
The registry key is the tricky part of this equation as the program values are stored in the Taskband Current User registry key. This key can be found at: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband. And it looks like:
Because the values above are unique to the specific programs pinned, you can deploy this registry key (along with a shortcut preference). This way involves a bit of work and isn’t self documenting. It does work if you have one standard taskbar for your environment that doesn’t change. For a simpler way, keep reading.
Pinning Programs to the Taskbar with Group Policy Scripts
Back in 2009, Microsoft released a pretty cool script that makes pinning programs a breeze. Lucky for me, a co-worker found this script and shared it. To get started, copy the script within this ZIP file to a network share. Your users will need read/execute rights to this script.
Next, create a new blank batch file to call this script. The script syntax looks like:
cscript "\\PATH\pinitem.vbs" /item:"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Office 2013\Outlook 2013.lnk" /taskbar
If you wish to pin multiple programs, just copy this line multiple times and change the /item path to the new application. In our environment, we pin five applications with no noticeable logon impact.
Once your batch file is complete, add it to a GPO that is linked to your users or use loopback to apply the taskbar to specific set of computers. On the next logon, your specified programs will appear on the Taskbar. If your users unpin the application, it will reappear on the next logon.
For some reason this doesn’t seem to work anymore with Windows 10 (Iäm using build 10586.164). The scipt says that pin goes ok but nothing appears in taskbar anyway.
I was trying to pin Internet Explorer shortcut next to Edge’s shortcut on taskbar. The correct shortcut can be found from C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Accessories\Internet Explorer.lnk , but pinning it fails. Can anyone confirm / fix this script?
I also cannot get this script to work with windows 10.
Here is a fix for Windows 10: https://deployhappiness.com/pin-programs-to-the-taskbar-in-windows-10/
I’m unable to make the script work on a dutch(NL, nederlands) version of windows. Someone here changed a few things to make it work with the german language. I am however unable to find what needs changing, since the scripts stops with “true” and no errors.
If someone has a suggestion, please help!
Try the solution on this page: https://deployhappiness.com/pin-programs-to-the-taskbar-in-windows-10/
I love this script — when it works. It’s a bit quirky.
Here’s what just happened and it’s NOT the first time.
I’ve followed all the setup steps, but when a user logs into a computer the first time, the icons don’t appear. I’d run gpupdate /force, reboot, log into a new desktop or laptop (even as me, the user, not administrator.
Run gpupdate a second time. Reboot.
Login again. Nothing. maybe a minute or two later, all my pre-programmed icons appear like magic.
But why the long delay?
What OS are you using Frank? If you are doing this on Windows 8.1, this is expected behavior. Logon scripts are delayed so that the user is able to login faster. You can adjust that setting here: http://blogs.technet.com/b/platformspfe/archive/2014/03/08/windows-8-1-logon-script-delay-group-policy-setting.aspx
Is it also possible to add Internet Explorer shortcuts to specific websites? If yes, how is this done?
Yes – I find it easier to open the site in IE, select Add sites to Programs (under IE Tools), and copy that shortcut to a share. Then deploy that shortcut with Group Policy File Preferences.
Thanks, thats the nicest and most simple solution to be found on the web I think.
I am using netlogon to run the cscript command. Additionally I’m creating a log-entry like %username%_%computername%.txt in a certain folder. My netlogon script checks whether the username/computername entry already exists, and if yes it bypasses to copy the taskbar items again. Quick and simple.
Glad that you like it!
I’ve tried the script with different OS (Win7 x32, Win7 x64), but it didn’t work for me.
cscript C:\tmp\PinItem.vbs /item:”c:\windows\system32\mspaint.exe”
Script tells me “Item pinned: True” but I can’t find the Item in the start menu
Did I anything wrong?
Thanks in advance,
Don’t forget the /taskbar option at the end of the script.
Thanks for your advice, but I’ve already tried with /taskbar and without (for pinning to the startmenu), but it doesn’t work both.
In the meantime I’ve also tried the script with Win7 Home; also without success.
I’m without any idea why this doesn’t work for me?
If you run it manually, kill explorer.exe, launch explorer.exe – you still have no new icons?
Thanks for your advice again, Joseph.
BUT unfortunately it won’t pin items to the taskbar or start menu.
OMG, I’m a fool. After reading the whole script, I’ve seen this is for English Windows and not for German. (itemverb.DoIt menu language difference)
Thank you very much!
Win8; server 2012. Great script and easy to follow. I successfully got GPO to install the .bat file in the startup menu of the client’s pc at logon but the batch file won’t run even on reboot. If I manually click the bat file in the start up folder and the programs get pin to the taskbar. Any suggestions why the bat file won’t run in the startup folder? thank you.
As a startup script, the batch file doesn’t know what user to put the icons under.
Joseph, thank you for taking the time to read my mail and reply.
I feel quite silly as I have discovered my error. I forgot I set desktop and menu redirected depending on admin, teacher, pupil to a folder. So all I had to do was drop the batch file in the startup folder on the redirected folder and bingo, it all worked. What I should have done (and took for granted) was to check the location of the folder by doing ‘shell:startup’. I couldn’t believe how stupid I have been. Anyway all is well. Thank you
Sometimes it takes a second look at things! Glad you got it straightened out!
Anyone have a good technique to remove task bar items via GP? For example, if I dont want Windows Explorer in the Taskbar which Windows does by default.
Has anyone found a solution to this? I would like to remove IE, Windows Explorer and Windows Media Player first, then ping the items that I want.
Would also like to know if it is possible to remove items. Anyone managed to crack it yet?
Now that I got the script working, I am running in an issue. Each time the users logon, batch script pins the shortcut link (application icon). So the pinned apps appears with numbers. For example, on the start menu Word appears as Word 2013 (4). Any idea on how to fix this, so that if the icon is already pinned, it does pin it again each time?
That is an odd problem. Give me a day or so and I bet I can modify this script for you.
Hey Stew – I haven’t been able to duplicate this issue. What OS are you using?
Thank you for looking into the issue and sorry I took so long to return with an update. Actually, I was away without internet access. The script works fine, and I found out what was causing the issue. I noticed the issue was only happening on the first group of machines I tested on. It turned out that when I initially tried to implement the shortcuts via the OCT Tools, it left the registry settings in the registry, which incidentally only work when the “pinitem” script runs creating duplicate entries of the shortcuts.
That is good to know Stew! Thanks for updating me.
good work, we can also look at http://www.morgantechspace.com/2014/04/Pin-Program-to-Taskbar-via-Group-Policy.html
I have seen that site a few times recently – he has some good posts!
I followed the instructions in your “Pinning Programs to the Taskbar with Group Policy Scripts” article, but cannot to work in a logon GPO. I tested on my desktop, and it works. If go to another user’s PC, then navigate to the location where the logon scripts are stored, and double clicked on the pinitem.bat file, it runs fine and pin the links. Do you have any idea why the pinitem script doesn’t work from the logon gpo script? I also checked the location where the vb script to make sure everyone has read/write/execute permission.
Hey Stew – are you sure the user is processing the logon script? Run a GPResult and doublecheck.
You can also modify the script and have it create a blank txt document in the user profile. Then you would be sure the script ran.
I ran a GPResult /r, and the GPO in question was listed under the section titled
“The following GPOs were not applied because they were filtered out”, so I don’t think the GPO was getting processed. I decided to redo the GPO and linked it directly o the “Users” OU instead of the top OU that contain both Users and Computers OU. Then it works. This is all set for right now. Thanks for your idea to check to see if the GPO is getting processed.
BTW, I am novice to scripting; How would I modify the script to create a blank txt document in the user profile? Thanks
with something like: