Help - Search - Members - Calendar
Full Version: Pin Items to Taskbar and/or Start Menu During Deploy
MSFN Forums > Unattended Windows Discussion & Support > Unattended Windows 7/Server 2008R2

   


Google Internet Forums Unattended CD/DVD Guide
gameadict
I found this tidbit on the MS site while trolling for other info. Thought it may be of use to others so I'm just sharing.

It explains how to automatically pin items to your taskbar or startmenu via scripting and includes an example script for calculator. I haven't tried this during an unattended install to see if it works as I'm still trying to work out other issues I'm having, but for others, this may be useful.

How to pin items to taskbar or start menu via scripting
SoultakerPT
Hi there!

Does anyone have any idea on how to do this for all users?

On Vista, all I add to do was:

1 - Configure the start menu with the pinned shortcuts that I wanted

2- Export the key HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StartPage

And then I just need to run the registry file and restart the computer.

Now this is not working anymore.

Any ideias about it?


Best Regards,
Soultaker
SmokingRope
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 &quot;REGEDIT /s C:\PinOnce.reg&quot;</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.
maxXPsoft
QUOTE (SmokingRope @ Oct 24 2009, 02:50 PM) *
I have played around with this for a while now, i figure someone else might be interested in the results:

thumbup.gif
but i kinda tried something a little different. For those don't know as long as the path don't have spaces you don't need quotes. So just to play I tried these 2 in the PinItemsToTaskbar.cmd using WScript

WScript.exe %systemdrive%\Install\PinToTaskbar.vbs %windir%\explorer.exe
WScript.exe %systemdrive%\Install\PinToTaskbar.vbs %windir%\notepad.exe

so will need to test using WScript in the Firstlogon


maxXPsoft
put both the vbs and the cmd in same dir and do this

PinItemsToTaskbar.cmd
CODE
cd /d %~dp0
WScript.exe %~dp0PinToTaskbar.vbs %windir%\explorer.exe
WScript.exe %~dp0PinToTaskbar.vbs %windir%\notepad.exe




Google Internet Forums Unattended CD/DVD Guide

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.