Is there are way to pin the "Run" button to taskbar through group policy or a script? Only the specific items needs to be pinned. The other items are not to be touched.
Partial solutions I found on net:
- pinitem.vbs , but can only pin binaries.
- The powershell solution uses the same mechanism.
I used partly the powershell you linked and partly Zoredache's stuff, and found the icon for the shortcut myself (not that huge a deal; I had an example in my start menu).
rundll32.exe shell32.dll,#61
orc:\windows\explorer.exe Shell:::{2559a1f3-21d7-11d4-bdaf-00c04f60b9f0}
like Zoredache suggested. Name it "Run."%windir%\system32\shell32.dll
. Choose the standard run icon.Run the powershell script:
$shell = new-object -com "Shell.Application"
$folder = $shell.Namespace('C:\path\to\run\icon')
$item = $folder.Parsename('run.lnk')
$item.invokeverb('taskbarpin')
You can put the icon on a user share (copying it to the workstation first?) and assign the powershell as a login script via group policy.
I tested running the script manually on Windows 7 and Windows 8. It didn't create duplicates when re-run.
@Zoredache's comment is partially correct, but it's missing some information. Pinned taskband items are actually comprised of two components: a .lnk shortcut in
%APPDATA%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\
AND a registry entry inHKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband
. You have to have both or it won't work. The registry key format isn't defined, so the easiest way is just pin what you want once by hand and then copy the registry key and shortcut to other systems.You can use Group Policy Preferences to deploy this en masse. Simply use GPP Registry to deploy the key and GPP Files to deploy the .lnk shortcut. This article has some good background information on the topic.