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 :).

Join Over 850 Internet Marketers!

SEO, PPC, Social Media, Affiliate Marketing, & WordPress Tips Delivered Right To Your Inbox, once a week.

I will never give away, trade or sell your email address. You can unsubscribe at any time.

28 Comments Copy Taskbar Icons Windows 7 Sysprep

  1. Pingback: Sysprep a Windows 7 Machine – Start to Finish V2 - Blog.BrianLeeJackson.com

  2. Steve

    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!

    Reply
  3. Jason

    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?

    Reply
  4. Chris

    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).

    Reply
  5. Johny N

    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.

    Reply
  6. Gill Bates

    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.

    Reply
  7. Scott E

    @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.

    Reply
  8. Pingback: Persistant mandatory profile issues...

  9. Breanna

    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.

    Reply
  10. tam

    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]

    Reply
  11. Jason

    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?

    Reply
  12. Jason

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

    Reply
  13. Jermaine

    @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.

    Reply
  14. lx.nvr

    U’re really the best. A rare blog with such detailed and easy step-by-step tutorials.

    Okay. The question is: can I do minor changes in the SYSPEPPED windows 7 installation?
    I have a sysprepped windows 7 on VMWare. For certain compatibility reasons i did not use VMWare snapshots.

    Reply
  15. Justin

    Does anyone know if you can get the imagex /apply to reboot automatically after it applies the WIM image??
    It would be great to apply the image and walk away for 10 minutes and let the whole unattend process take care of itself. Right now I apply the image, wait for it to complete (about 5 mins) and then reboot for it to complete the rest.

    Thanks.

    Reply
  16. mo

    Why cant you just copy the profile to the default profile, i feel like this was much easier to do in XP.

    None of my Start Menu icons are the same (i want it blank) and none of the Task Bar icons stay pinned or unpinned, its just like default windows stuff.

    Any way to do this without scripting, it seems all the things i need done that WSIM is supposed to do i have to script (domain join, extra drivers, now this!!!)

    Reply
  17. Dustin

    @Jason
    Did you ever get the Quick Luanch figured out? I know with Win7 there is no quick launch, but there are ways to add it. NOt sure if that is the problem or not.
    I have set in my unattend.xml DoNotClean TaskBar=True and still no luck.

    Reply
  18. Pingback: Sysprep a Windows 7 Machine – Start to Finish V2 - Brian Lee Jackson

Leave A Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>