Pin Items to Taskbar and/or Start Menu During Deploy
#1
Posted 04 June 2009 - 06:26 AM
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
#2
Posted 28 August 2009 - 06:28 AM
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
#3
Posted 24 October 2009 - 01:50 PM
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:
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.
"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.
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)
<?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.
This post has been edited by SmokingRope: 24 October 2009 - 01:52 PM
#4
Posted 26 October 2009 - 06:14 AM
SmokingRope, on Oct 24 2009, 02:50 PM, said:
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
#5
Posted 26 October 2009 - 06:38 PM
PinItemsToTaskbar.cmd
cd /d %~dp0 WScript.exe %~dp0PinToTaskbar.vbs %windir%\explorer.exe WScript.exe %~dp0PinToTaskbar.vbs %windir%\notepad.exe
#6
Posted 10 July 2010 - 04:08 AM
I have tried multiple .vbs scripts tp pin ad unpin tasks from taskbar, but no one works for me, something i don´t do well. can someone help me please?
here are the scripts i have tried:
http://blogs.technet...via-script.aspx
http://social.techne...56-383b374bca88
This post has been edited by Major: 10 July 2010 - 06:17 AM
#7
Posted 10 July 2010 - 11:35 AM
#8
Posted 10 July 2010 - 06:03 PM
Major, on 10 July 2010 - 11:35 AM, said:
I just done it on a running windows and it worked. Place the cmd file and the vbs script in same folder
PinTaskbar.cmd
cd /d %~dp0 WScript.exe %~dp0PinToTaskbar.vbs %windir%\explorer.exe WScript.exe %~dp0PinToTaskbar.vbs %windir%\notepad.exe Exit
PinToTaskbar.vbs
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
#9
Posted 10 July 2010 - 06:31 PM
#10
Posted 11 July 2010 - 05:39 AM
#11
Posted 11 July 2010 - 05:52 AM
Thanks
#12
Posted 12 July 2010 - 06:23 AM
#13
Posted 12 July 2010 - 08:32 AM
Kevin
#14
Posted 12 July 2010 - 11:27 AM
Thanks you very much @maxXPsoft for your help.
- ← OObe usually appears after using sysprep and not applied the tweaks
- Unattended Windows 7/Server 2008R2
- WDS ignores answer file →



Help
Back to top









