Public objApp, objFSO
Set objApp = CreateObject("Shell.Application")
Set objFSO = CreateObject("Scripting.FileSystemObject")
UnPin("C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe")
'************************Start of UnPin()
Function UnPin(SourceFileNameAndPath)
'Unpins from the taskbar the program who's sources is provided
'Syntax: UnPin(<full path of shortcut's target>)
'Example: UnPin("C:\Windows\explorer.exe") 'Unpin explorer from the taskbar
ParentFolder = Left(SourceFileNameAndPath,InStrRev(SourceFileNameAndPath,"\") - 1)
Filename = Right(SourceFileNameAndPath,Len(SourceFileNameAndPath) - InStrRev(SourceFileNameAndPath,"\"))
If objFSO.FileExists(SourceFileNameAndPath) Then
Set objFolder = objApp.Namespace(ParentFolder)
Set objFolderItem = objFolder.ParseName(Filename)
Set colVerbs = objFolderItem.Verbs
For Each objVerb in colVerbs
If Replace(objVerb.name,"&","") = "Unpin from Taskbar" Then
objVerb.DoIt
End If
Next
End If
End Function'<==UnPin()
'************************End of UnPin()