I have played around with this for a while now, i figure someone else might be interested in the results:
Create a new WSH Script (which is very similar to that from the link posted by op). (
http://blogs.technet.com/deploymentguys/ar...via-script.aspx)
My script (stored at C:\PinToTaskbar.vbs) looks as follows:
CODE
Set objShell = CreateObject("Shell.Application")
set filesystem = CreateObject("scripting.Filesystemobject")
Set objFolder = objShell.Namespace(filesystem.GetParentFolderName(Wscript.Arguments(0)))
Set objFolderItem = objFolder.ParseName(filesystem.GetFileName(WScript.Arguments(0)))
Set colVerbs = objFolderItem.Verbs
For Each objVerb in colVerbs
If Replace(objVerb.name, "&", "") = "Pin to Taskbar" Then objVerb.DoIt
If Replace(objVerb.name, "&", "") = "Unpin from Taskbar" Then objVerb.DoIt
Next
Create ONE batch file (at C:\PinItemsToTaskbar.bat) which then executes the above WSH script using cscript.exe for each program you want to pin.
CODE
"C:\Windows\System32\cscript.exe" "C:\PinToTaskbar.vbs" "C:\Program Files\Microsoft Office\Office12\WINWORD.exe"
"C:\Windows\System32\cscript.exe" "C:\PinToTaskbar.vbs" "C:\Program Files\Microsoft Office\Office12\VISIO.exe"
"C:\Windows\System32\cscript.exe" "C:\PinToTaskbar.vbs" "C:\Program Files\Microsoft Office\Office12\EXCEL.exe"
Create a registry script (at C:\PinOnce.reg) which will execute the above batch file at first logon for each user.
CODE
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce]
"SetupTaskbarPins"="C:\\PinItemsToTaskbar.bat"
Now load this registry file during your unattended installation within the auditUser pass before generalization (or however else you might try and do it)
CODE
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="auditUser">
<component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<RunSynchronous>
<RunSynchronousCommand wcm:action="add">
<Order>500</Order>
<Path>cmd /c "REGEDIT /s C:\PinOnce.reg"</Path>
<Description>Load User Settings</Description>
</RunSynchronousCommand>
</RunSynchronous>
</component>
</settings>
</unattend>
I have tried unsuccessfully, to execute the WSH script during the auditUser pass using a RunSynchronous command. I Have tried unsuccessfully to execute the WSH script using the OOBE FirstLogonCommand. I have tried setting the FirstLogonCommand parameter "RequiresUserInput" to both true and false.
I then tried to bypass the "PinItemsToTaskbar.bat" file by placing all the pin commands into the registry RunOnce; however it appears that the WSH script cannot be run multiple times simultaneously, and this caused unpredictable things to happen. The above steps are only method i have successfully used to pin items to the taskbar.