Welcome to MSFN

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.


piglovesrat15

Command to Pin or Unpin Program from Taskbar

6 posts in this topic

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.

0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

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

0

Share this post


Link to post
Share on other sites

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

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.