Copy Taskbar Icons Windows 7 Sysprep

THIS IS OLD, VERSION 2 IS NOW AVAILABLE – CLICK HERE

Sorry for not posting this earlier but I have had a rough last couple months. Just now getting back into the swing of things.

When running sysprep in Windows 7 with the unattend.xml file, you will probably notice that the taskbar icons are something that don’t copy over. Well that is because the icons are not part of the users profile. So the copyprofile=true command does work for almost everything, but it doesn’t copy over your taskbar icons.

Thankfully the “Deployment Guys” already have a VBS script that will pin and unpin icons. I have edited this script and done most of the hard work for you. Basically we are going to dump a few scripts into the “startup folder” (and yes I said startup folder, it is messy but it works and finishes clean) which will run only the first time every new user logs in. It will pin the icons you want, in any order you want, both to the taskbar and the startmenu and then the script is deleted from the startup folder and never runs again for that user. It does work perfectly and I currently am using this in a corporate environment with around 400-500 computers.

Step #1

Download the scripts that I have packaged together. Click here to download. Again, most of these scripts were written by The Deployment Guys, I have just tweaked them and added a few. It is a 35mb zip file.

The zip file contains the following files:

- taskbar.bat
- taskbar_operations.cmd
- pin.wsf
- unpin.wsf
- pinitem.vbs
- listverbs.vbs
- zti-specialfolderlib.vbs
- ztiutility.vbs

You are going to drop these scripts into the correct places during audit mode.

Step #2

Copy the taskbar.bat file into the startup folder in the start menu.

Below is an explanation of what that taskbar.bat file is doing:

cd C:\Windows\Scripts\
This changes the directory to the scripts folders.

call taskbar_operations.cmd
Calls the cmd file which unpins and pins the taskbar icons.

cd C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup”
This changes the directory to the startup folder.

DEL taskbar.bat
This deletes the taskbar.bat after it is done, so it won’t run again for that user.

Step #3

The taskbar_operations.cmd file is the file that has all the custom icon paths in it that are pinned or unpinned.
My file has the following in this order:

Windows Explorer, IE, Firefox, Word, Excel, Outlook, WMP

If you want to change these, simply look in the cmd file and you will figure out what you need to change, it is pretty simple. Also, the default order when running sysprep is WMP, IE, and Windows Explorer, so the script is actually unpinning WMP, unpinning IE, (windows explorer is now bumped over to the left side) and then it pins the rest of the icons in order.

Step #4

Create a “scripts” folder in the C:\Windows directory and drop all of the files into it, except for the taskbar.bat file which you should already have in your startup folder.

Step #5

Now run sysprep as you normally would and the scripts are copied into the default profile. That means for every new user, the scripts pin the icons in the order you want, the script then deletes itself and never runs again. For the correct procedure on sysprepping your machine, read my Windows 7 Sysprep Tutorial.

I am definitely not a programmer, but this works, and I don’t see Microsoft giving us a better solution :) .

Share and Enjoy:
  • Twitter
  • Facebook
  • Digg
  • del.icio.us
  • Technorati
  • StumbleUpon
  • Google Bookmarks

Tags: , , ,

21 Responses to “Copy Taskbar Icons Windows 7 Sysprep”

  1. [...] AS OF JUNE 16TH: Read my Taskbar Icons Tutorial before [...]

  2. Jesse Gaither says:

    You’re the best. ;)

  3. Steve says:

    Thanks Brian! I haven’t tried this yet but I will very soon! Hope everything is going ok and you are back in the Windows 7 game! Thanks for you continuing effort to help guys like me out with this, you rock!

  4. Jason says:

    What about the quick launch? We don’t use pin icons but we do use the quick launch is there away to get this to work withthe quick launch?

  5. Josh says:

    Awesome, this will be a big help in our Win7 sysprep workflow. Thanks for sharing your work, Brian!

  6. Chris says:

    Thanks Brian. Tried it and it works just fine.

    @Jason

    i believe that’s what he’s referring to in the tutorial (taskbar holds those icons).

  7. Johny N says:

    Man, just a day too late for me! I just developed a process very similar to this myself just yesterday!

    To simplify the script deletion, you could just add “del %0″ at the end of the taskbar.bat file.

  8. Chris says:

    also in addition to the fact that it works… the scripts are only 35KB and not 35MB :)

    Thanks again Brian.

  9. Gill Bates says:

    Thanks dude, ive been looking everywhere for a solution for this and its the easiest ive found. However is there anyway to have the cmd window that pops up when you first log on run in the background it could confuse my users if they see it.

  10. Scott E says:

    @Jason (above):
    Shortcuts in the Quick Launch folder are profile-specific, so if you configure Win7 to use Quick Launch and add the shortcuts you want, it should be copied over normally with the rest of your profile configuration due to the copyprofile=true setting.

  11. [...] and I currently am using this in a corporate environment with around 400-500 computers. Source: http://blog.brianleejackson.com/copy…dows-7-sysprep Reply With Quote [...]

  12. vik says:

    35Mb? Was a bit smaller when I downloaded it :)

  13. Thanks :) Don’t forget to check out version 2 with one single vbs script!!
    http://blog.brianleejackson.com/copy-taskbar-icons-windows-7-sysprep-v2

    Enjoy!

  14. @Gill Bates. I have a version 2 out now that is a single VBS script, it unpins, pins, works silently in the background, and then deletes itself :) Enjoy!

  15. Breanna says:

    Man, just a day too late for me! I just developed a process very similar to this myself just yesterday!

    To simplify the script deletion, you could just add “del %0″ at the end of the taskbar.bat file.

  16. tam says:

    If you know what you’re doing, you can also stick this registry key with all the values in it into the Default hive:

    [HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband]

  17. Jason says:

    Hey thanks for the tip about the Quick Launch but for some reason it doesn’t stay after I sysprep. The toolbar is gone and the taskbar with windows media and all that crap comes back. Any ideas?

  18. Jason says:

    Anyone figure out why my custom toolbar keeps going away after syspreping? and i get the pinned icons everytime

  19. Jason says:

    @Scott E
    It isn’t working everytime i sysprep I loose my custom toolbar and i get the pinned icons

  20. Jermaine says:

    @Jason,

    I haven’t tried this myself quite yet but in the Shell_Setup answer file component there’s a switch called “DoNotCleanTaskbar”. It’s appears in the generalize, specialize, auditSystem and oobe passes. According to the unattend reference help doc, “DoNotCleanTaskBar specifies whether Sysprep removes deskbands. A deskband is a customized toolbar that can be added to the taskbar. Deskbands contain shortcuts to frequently performed tasks.” I think this would apply to added custom toolbars.

Leave a Reply