Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 



piglovesrat15

Command to Pin or Unpin Program from Taskbar

Recommended Posts

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.

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.

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.

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.

×