3

I just had to have my laptop re-imaged and am getting it all configured again. There were some items pinned to my taskbar from the image and when I unpin them, they come back after a reboot. I have seen lots of comments about clearing out %AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar and removing HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband. Also notes about c:\Users\Public\CompanyProfile (which does not exist for me). None of these tricks have worked. I even created a new users and am seeing the same problem on that account. Another symptom I have is that when I default my browser to Firefox, it resets to IE after reboot. I have checked and I cannot see any group policy that is driving this behavior. I am out of ideas.

Installed programs to stick and items I place on my desktop do survive a reboot. In looking around I tried a batch program to help and noticed that if I run these commands in DOS:

taskkill /f /im explorer.exe
start explorer.exe

It resets the taskbar and file associations.

LtlBear
  • 111
  • 1
  • 4
  • 9

1 Answers1

1

I don't have a good answer for a permanent fix. However, I was able to mask the problem. I ended up creating a task to run when I log in. That task runs the script below and unpins to the items from the taskbar.

Option Explicit

Dim objFSO, objShell, objFile, objFolder, objFolderItem, colVerbs, objShellApp, objVerb
Dim strFileNameAndPath

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("WScript.Shell")
Set objShellApp = CreateObject("Shell.Application")

' ***********************************************
' Unpin Internet Explorer
' ***********************************************
strFileNameAndPath = objShell.ExpandEnvironmentStrings("%APPDATA%") & _
 "\Microsoft\Internet Explorer\Quick Launch\User Pinned\Taskbar\Internet Explorer.lnk"

 ' Verify the files exists.  If not, we are got and don't need to do Anything
If objFSO.FileExists(strFileNameAndPath) Then
    set objFile = objFSO.GetFile(strFileNameAndPath)
    Set objFolder = objShellApp.Namespace(objFile.ParentFolder & "\")
    Set objFolderItem = objFolder.ParseName(objFile.Name)
    Set colVerbs = objFolderItem.Verbs
    For Each objVerb In colVerbs
        If LCase(Replace(objVerb.name, "&", "")) = "unpin from taskbar" Then objVerb.DoIt
    Next
End If

' ***********************************************
' Unpin Windows File Explorer
' ***********************************************
Set objFolder = objShellApp.Namespace("C:\ProgramData\Microsoft\Windows\Start Menu Places")

For each objFolderItem in objFolder.Items
    If InStr(1, objFolderItem.Name, "Explorer", vbTextCompare) > 0 Then
        objFolderItem.InvokeVerb("taskbarunpin")
    End If
Next

Set objVerb = Nothing
Set colVerbs = Nothing
set objFile = Nothing
Set objFolder = Nothing
Set objFolderItem = Nothing
Set objFSO = Nothing
Set objShell = Nothing
Set objShellApp = Nothing

A special thanks to Syberdoor who helped me figure out the file explorer code (Unpin File Explorer from the taskbar in Windows 10 via script or batch file)

LtlBear
  • 111
  • 1
  • 4
  • 9