MSFN Forum: Pin Items to Taskbar and/or Start Menu During Deploy - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Pin Items to Taskbar and/or Start Menu During Deploy

#1 User is offline   gameadict 

  • Group: Members
  • Posts: 7
  • Joined: 14-June 04

Posted 04 June 2009 - 06:26 AM

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


#2 User is offline   SoultakerPT 

  • Junior
  • Pip
  • Group: Members
  • Posts: 87
  • Joined: 07-June 04

Posted 28 August 2009 - 06:28 AM

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

#3 User is offline   SmokingRope 

  • Newbie
  • Group: Members
  • Posts: 18
  • Joined: 02-July 05

Posted 24 October 2009 - 01:50 PM

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:

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

This post has been edited by SmokingRope: 24 October 2009 - 01:52 PM


#4 User is offline   maxXPsoft 

  • MSFN Master
  • Group: Developers
  • Posts: 2,482
  • Joined: 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 26 October 2009 - 06:14 AM

View PostSmokingRope, on Oct 24 2009, 02:50 PM, said:

I have played around with this for a while now, i figure someone else might be interested in the results:

:thumbup
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 User is offline   maxXPsoft 

  • MSFN Master
  • Group: Developers
  • Posts: 2,482
  • Joined: 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 26 October 2009 - 06:38 PM

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

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


#6 User is offline   Major 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 303
  • Joined: 30-January 05

Posted 10 July 2010 - 04:08 AM

@maxXPsoft, i have tried to execute the .cmd but without succeess, it does not pin any item.
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 User is offline   Major 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 303
  • Joined: 30-January 05

Posted 10 July 2010 - 11:35 AM

The scripts i have tried to install, i did it in a windows already installed, i donīt know if this situation would affect the executing of the script without any change.

#8 User is offline   maxXPsoft 

  • MSFN Master
  • Group: Developers
  • Posts: 2,482
  • Joined: 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 10 July 2010 - 06:03 PM

View PostMajor, on 10 July 2010 - 11:35 AM, said:

The scripts i have tried to install, i did it in a windows already installed, i donīt know if this situation would affect the executing of the script without any change.

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 User is offline   Major 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 303
  • Joined: 30-January 05

Posted 10 July 2010 - 06:31 PM

I'll go crazy, i have done what you told me but without success, i donīt see no notepad neither no explorer on the taskbar.

#10 User is offline   maxXPsoft 

  • MSFN Master
  • Group: Developers
  • Posts: 2,482
  • Joined: 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 11 July 2010 - 05:39 AM

View PostMajor, on 10 July 2010 - 06:31 PM, said:

I'll go crazy, i have done what you told me but without success, i donīt see no notepad neither no explorer on the taskbar.

I thought max was 3 but I keep running and more get added.
I had given that up and went back to Quicklaunch myself

#11 User is offline   Major 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 303
  • Joined: 30-January 05

Posted 11 July 2010 - 05:52 AM

I think i am missing installing some libraries or some programs of windows to execute it because i have tried it in a running windows in vmware (only windows 7 is installed). i have seen that no file .vbs of adding or unpin item is executed, or i am wrong?
Thanks

#12 User is offline   maxXPsoft 

  • MSFN Master
  • Group: Developers
  • Posts: 2,482
  • Joined: 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 12 July 2010 - 06:23 AM

I disable UAC at offlineServicing and 1 other thing I am on Premium cause I didn't like having to Hide all the language updates on Ultimate. May have had an issue with ultimate running those scripts. I know I disabled that Taskbar Pinned part in my app while i worked on it.

#13 User is offline   kevin34 

  • Newbie
  • Group: Members
  • Posts: 25
  • Joined: 16-April 10
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 12 July 2010 - 08:32 AM

Is it possible to just use WinRar, make an .sfx archive of the quicklaunch icons you want and have them auto-extract to C:\Users\[ProfileName]\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar? Or you could extract them to the default user profile. I used to do this in XP successfully. I am actually more interested in automatically removing the default quicklaunch items, unfortunately it seems that isn't possible. Any suggestions appreciated, have a good day everyone.

Kevin

#14 User is offline   Major 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 303
  • Joined: 30-January 05

Posted 12 July 2010 - 11:27 AM

I have found the solution, the problem was i didnīt know how the script works. Then i see the script works as a right click on the item, i changed the words to spanish and it worked well.
Thanks you very much @maxXPsoft for your help.

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy