MSFN Forum: Command to Pin or Unpin Program from Taskbar - MSFN Forum

Jump to content


Windows 7 forum rules

If you have questions about customizing Windows 7 that are vLite-specific, please post them in the vLite forum, not here. If you have questions regarding the unattended installation of Windows 7, please post them in the Unattended Windows 7/Server 2008 R2 section.
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Command to Pin or Unpin Program from Taskbar

#1 User is offline   piglovesrat15 

  • Newbie
  • Group: Members
  • Posts: 16
  • Joined: 21-December 10
  • OS:none specified
  • Country: Country Flag

Posted 03 November 2011 - 08:19 AM

Hello. Just want to ask anyone out there if they know a command to pin or unpin a program from taskbar. I know how to pin or unpin manually using the mouse and the shortcuts are in "%appdata%\Microsoft\Internet Explorer\Quick Launch\User Pinned\Taskbar".

What I try to do is run command if a specific shortcut in there, then delete it. I use the DEL command, it only deletes the shortcut in "%appdata%\Microsoft\Internet Explorer\Quick Launch\User Pinned\Taskbar" folder but the icon (even though it's now blank) still pins from the taskbar.

Thanks.


#2 User is offline   cluberti 

  • Gustatus similis pullus
  • Group: Supervisor
  • Posts: 11,208
  • Joined: 09-September 01
  • OS:Windows RT
  • Country: Country Flag

Posted 03 November 2011 - 03:55 PM

You can use vbscript to do it, but there's no command or API (by design) to handle this.

http://blogs.technet...via-script.aspx

#3 User is offline   powerdown 

  • Group: Members
  • Posts: 2
  • Joined: 13-October 11
  • OS:none specified
  • Country: Country Flag

Posted 08 November 2011 - 09:27 AM

I use two commands to do this. I got them from somewhere, can't remember where right now. First is a VBscript that preforms the operation you can shange the "Pin to Start Menu" to "Pin to Taskbar" (same for "Unpin...":

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 Start Menu" Then objVerb.DoIt
If Replace(objVerb.name, "&", "") = "Unpin from Start Menu" Then objVerb.DoIt
Next

Then I make a cmd file with the items I want to Pin and point them to the VBScript:

cd /d %~dp0
WScript.exe %~dp0PinToStartMenu.vbs "path to app you want to Pin"

You can add multiple Items in the cmd file to Pin/Unpin all the items you want.

#4 User is offline   IcemanND 

  • MSFN Junkie
  • Group: Super Moderator
  • Posts: 3,266
  • Joined: 24-September 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 08 November 2011 - 06:41 PM

I have a powershell script somewhere that will let you pin and unpin items to the taskbar and the start menu. If you are interested let me know and I can look for it and post it.

#5 User is offline   piglovesrat15 

  • Newbie
  • Group: Members
  • Posts: 16
  • Joined: 21-December 10
  • OS:none specified
  • Country: Country Flag

Posted 09 November 2011 - 08:15 AM

Thanks to all three. IcemanND - No need to, the VBScript is enough. Thanks again.

#6 User is offline   xpclient 

  • XP was my idea. I had to fight Windows 7 to make it my idea
  • PipPip
  • Group: Members
  • Posts: 233
  • Joined: 30-July 05
  • OS:XP Pro x64
  • Country: Country Flag

Posted 18 October 2012 - 11:59 AM

A year late to revive this post but Taskbar Pinner will be most useful to you guys. :)

Share this topic:


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

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



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