Friday, 4 April 2014

Pin Program to Taskbar via Group Policy


   In this article, I am going write step-by-step guide for how to Pin a Program to Taskbar via GPO. There is no direct Group Policy Preference setting to Pin Items to Taskbar via GPO for all users. We are going to achieve via Logon Script. before start to read, pleas click to download vbscript: Download PinItems . Here, I have explained two processes, Pin Program to Taskbar in Local PC and Pin Application to Taskbar through GPO for all users.


How to Pin a Program to Taskbar in Current Machine

   In Windows 7, Taskbar pinned items are stored in the following locations:

File System: %APPDATA%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar

Registry: [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband]

Steps to Pin Programs/Items to Taskbar in Current Machine:

1.  Click to download the vbscript file PinItems Download PinItems.
2.  Place the downloaded vbscript file in your favourite place. I have placed here -> C:\Scripts\PinItem.vbs
3.  Now run the following command in Command Prompt to Pin MS Paint Program to Taskbar.
cscript C:\Scripts\PinItem.vbs /taskbar /item:"c:\windows\system32\mspaint.exe"
Pin Program/Items to Taskbar via GPO

4. Then go the Taskbar pinned items location : %APPDATA%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar and you can see the shortcut icon for paint.

Pin a Program/Items to Taskbar via GPO

Note: Here, you can replace your own program's exe path which you are going to pin it in taskbar.
Ex: Use the below command to pin uTorrent in taskbar.
cscript C:\Scripts\PinItem.vbs /taskbar /item:"C:\Program Files\uTorrent\uTorrent.exe"

How to Pin a Program to Taskbar via GPO

   After read the above steps, you may guess what we are going to do to Pin a Program to Taskbar via Group Policy. We are going save the above commands in script or batch file and run through GPO's logon script to Pin a Programs to Taskbar for all user's computer.

Steps to Pin a Program/Item to Taskbar through GPO:

1. Click to download the vbscript file PinItems Download PinItems.

2. Place the downloaded vbscript file in any share path(Network Share). I have placed here -> \\devDC\share\PinItem.vbs

3. Open new Notepad file, copy the below command and paste in Notepad.
cscript C:\Scripts\PinItem.vbs /taskbar /item:"c:\windows\system32\mspaint.exe"
4. Save the Notepad file with the extension .bat like PinProgram.bat

5. Place the PinProgram.bat file into same share path where you placed PinItem.vbs (\\devDC\share\PinProgram.bat)

Pin Program/Items to Taskbar via GPO

6. Open the Group Policy Management console by running the command gpmc.msc.

7. Expand the tree and Right-click on the OU you want this policy to be applied to. Now, I am going to apply users who are under the OU DesignTeam. so right-click on the OU DesignTeam, and click Create a GPO in this domain, and Link it here...
Pin Program/Items to Taskbar via Group Policy

8. Give new policy name and click OK. Here, I am giving policy name Pin-Taskbar-Program-Policy

How to Pin Program to Taskbar via GPO

9. Now right-click on the newly created GPO Pin-Taskbar-Program-Policy and click edit.

How to Pin Items/Program to Taskbar through GPO

10. Go to the settings Scripts under User Configuration (User Configuration->Policies->Windows Settings->Scripts(Logon/Logoff)). In the right side pane, click Logon.

Pin Application to Taskbar through GPO

11. Add the batch file path \\devDC\share\PinProgram.bat in logon Script Name and click OK.

How to Pin a Program to Taskbar via GPO preferences

12. Click Apply to apply Logon Script settings.

How to Pin Items/Programs to Taskbar via GPO

13.Run the command gpupdate /force to apply gpo to all the users under the OU DesignTeam.

How to Pin Items to Taskbar via GPO

Now, you have configured new GPO to Pin a Program/Item to Taskbar via GPO in all user's computer. when an user login, this script automatically run and Pin programs to Taskbar.

Related Articles:

Add Environment Variable via Group Policy
Add desktop shortcut icon through Group Policy
Pin Program to Taskbar via Group Policy
Add start menu shortcut via Group Policy



  1. I am using exactly this method to provide shortcuts to programs for all of our users via GPO. Can this script be adapted to push website shortcuts to the taskbar (http)? We have a dedicated site for all of our "employees" (we are a NPO) to use and I would like to provided a taskbar shortcut for all users on all workstations.

    Thanks, GHowey

    1. Hi GHowey, you can achieve this via desktop shortcut instead of taskbar shortcut ... check this article

    2. Thanks, already knew that one. I have found no method other that pushing taskband registry and taskbar folder via gpo, but users become upset when all their current "Pinned Items" disappear. Was looking a method to "pin" website short cut to taskbar for all users. However, keep up the good work, I have found quiet a bit of good helpful information on your site!

    3. Ok Friend, I will try to hack the windows machanism for this task and write one more article if it possible.

    4. Thank You, will check regularly to monitor your progress!

    5. I think you could use a .lnk file instead of the exe but i'm not sure. Try making a .lnk with something like ["C:\Program Files\Internet Explorer\iexplore.exe"] (without the [] ofc.) and place it on a network share. Then call the network path\bla.lnk instead of the exe

    6. Morgan, how is your progress? I eagerly await your hack on this mechanism for this task if possible.

  2. I am looking for a method to pin a folder or a shortcut of a folder which contains multiple other shortcuts for my users. From my research, there is no "verb" available for these type of scripts which allows pinning a non-application such as a file or folder.

    Any tips/suggestions?

  3. I’ve tried the script with different OS (Win7 x32, Win7 x64), but it didn’t work for me.
    cscript C:\Scripts\PinItem.vbs /taskbar /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,

  4. I have configured same on my Win-2012 server i have configured AD on this server. My question is if I install same applications on my other servers which is already member of this AD so this script work for all other servers? I tried but its work fine in AD server but not with other servers which is in same domain.

    1. Do you have placed the script file in shared folder (network share) which is accessible from other computers?

  5. Hi there,

    We are using this script, and it is working. One thing we have noticed is that it will sometimes create a duplicate item on the taskbar. Does anyone have a fix for that?

  6. Hello
    I am trying to make this work, using a 2008 R2 server and win7 pro clients
    Created a folder inside netlogon and placed both the .bat and .vbs inside
    Called it from GPO in logon script
    nothing gets pinned to the menu
    If I go local on any client, and I run it directly from command prompt, the result says item pinned: true
    But, the thing is, there is nothing pinned on the menu
    Have tried it with both regular users and administrative users, same result
    if I do it manually on the clients, which is manually pinning the application and then deleting the link from the menu, running the script adds the link back, so it seems that the problem is something not being done by the script?
    Can you please shed some light on this for me?
    Thank you a lot in advance