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.
Page 1 of 1
Command to Pin or Unpin Program from Taskbar
#2
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
http://blogs.technet...via-script.aspx
#3
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.
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
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
Posted 09 November 2011 - 08:15 AM
Thanks to all three. IcemanND - No need to, the VBScript is enough. Thanks again.
#6
Posted 18 October 2012 - 11:59 AM
Share this topic:
Page 1 of 1



Help
Back to top











