Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

Command to Pin or Unpin Program from Taskbar


  • Please log in to reply
5 replies to this topic

#1
piglovesrat15

piglovesrat15

    Newbie

  • Member
  • 30 posts
  • Joined 21-December 10
  • OS:none specified
  • Country: Country Flag
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.


How to remove advertisement from MSFN

#2
cluberti

cluberti

    Gustatus similis pullus

  • Supervisor
  • 11,254 posts
  • Joined 09-September 01
  • OS:Windows 8.1 x64
  • Country: Country Flag
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
MCTS Windows Internals, MCITP Server 2008 EA, MCTS MDT/BDD, MCSE/MCSA Server 2003, Server 2012, Windows 8
--------------------
Please read the rules before posting!
Please consider donating to MSFN to keep it up and running!

#3
powerdown

powerdown
  • Member
  • 2 posts
  • Joined 13-October 11
  • OS:none specified
  • Country: Country Flag
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
IcemanND

IcemanND

    MSFN Junkie

  • Super Moderator
  • 3,272 posts
  • Joined 24-September 03
  • OS:Windows 8.1 x64
  • Country: Country Flag
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
piglovesrat15

piglovesrat15

    Newbie

  • Member
  • 30 posts
  • Joined 21-December 10
  • OS:none specified
  • Country: Country Flag
Thanks to all three. IcemanND - No need to, the VBScript is enough. Thanks again.

#6
xpclient

xpclient

    XP was my idea. 3rd party apps make NT6 my idea.

  • Member
  • PipPipPip
  • 336 posts
  • Joined 30-July 05
  • OS:XP Pro x64
  • Country: Country Flag
A year late to revive this post but Taskbar Pinner will be most useful to you guys. :)

Impossible to run NT6 without third party fixes.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users