Skip to content

Instantly share code, notes, and snippets.

@thomaswilburn
Created January 29, 2020 16:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomaswilburn/89d758a4da003eed7c14d61deb53781c to your computer and use it in GitHub Desktop.
Save thomaswilburn/89d758a4da003eed7c14d61deb53781c to your computer and use it in GitHub Desktop.
Unpin taskbar icons
Set ShellApp = CreateObject("Shell.Application")
Set FSO = CreateObject("Scripting.FileSystemObject")
homeFolder = ShellApp.NameSpace(&H28).Self.Path
PinnedPath = homeFolder & "\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar"
Set PinnedNS = ShellApp.NameSpace(PinnedPath)
Set PinnedFolder = FSO.GetFolder(PinnedPath)
Set PinnedFiles = PinnedFolder.Files
For each file In PinnedFiles
if FSO.GetExtensionName(file.Name) = "lnk" Then
Set FolderItem = PinnedNS.ParseName(file.Name)
For each verb in FolderItem.Verbs
english = LCase(Replace(verb, "&", ""))
if english = "unpin from taskbar" Then verb.DoIt
Next
End If
Next
Set FSO = Nothing
Set ShellApp = Nothing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment