Created
January 29, 2020 16:50
-
-
Save thomaswilburn/89d758a4da003eed7c14d61deb53781c to your computer and use it in GitHub Desktop.
Unpin taskbar icons
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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