Unpin the new Edge from Windows 10 taskbar with Powershell
Asked Answered
P

2

5

Here's the code I have been using... (and it's been working great!)

function DoUnpin([string]$appname) {
   $ErrorActionPreference = 'silentlycontinue'
    ((New-Object -Com Shell.Application).NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}').Items() `
     | Where-Object { $_.Name -eq $appname }).Verbs() `
     | Where-Object { $_.Name.replace('&', '') -match 'Unpin from taskbar' } `
     | ForEach-Object { $_.DoIt(); }
   $ErrorActionPreference = 'continue'
}
DoUnpin "Microsoft Store"
DoUnpin "Mail"
DoUnpin "Store"
DoUnpin "Edge"
DoUnpin "Microsoft Edge"

But in the last couple weeks Microsoft has been rolling out the new Chromium-based Edge (the one with the swirly icon) and I have not been able to figure out how to unpin it without using the mouse/GUI.

Anyone have any inisght on as to why this might be?

Plumy answered 4/12, 2020 at 20:59 Comment(0)
N
5

MS is getting sneakier with their edge-forcefulness. It is now saved (for new users on 20H2) in the Registry under:

"HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband"

Under "Favorites."

That key is where the user modifications to the taskbar are saved. Since we want to remove Edge from there for new users just delete that Key and all values inside of it which will remove all taskbar customizations. If you have a custom LayoutModification.xml it will still apply your customizations without the forced pinned Edge shortcut in the Taskbar.

Remove-Item "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband" -Recurse -Force

Then just stop and restart the Explorer process and the shortcut is removed for the current user.

Stop-Process -Processname Explorer -WarningAction SilentlyContinue -ErrorAction SilentlyContinue -Force

If you want this to happen for all new users you can add a RunOnce key to the Default registry hive to run the above two commands.

Nolannolana answered 7/12, 2020 at 1:22 Comment(2)
I am using Windows 10 (1909) and removing that taskband regkey removed the new edge taskbar pin and the explorer taskbar pin and the store taskbar pin, but didn't remove the mail taskbar pin... i can still remove that with the method in my question post. THANKSPlumy
UPDATE: the original code I posted now works again without having to resort to removing the whole taskband (but still it's a good answer)Plumy
O
1

You could try reviewing the LayoutModification.xml file. If there's an Edge entry in there, it will just keep getting pinned to Taskbar.

The file is in %userprofile%\AppData\Local\Microsoft\Windows\Shell.

If the file exists, open it and look for a "CustomTaskbarLayoutCollection" section. Then check for any Edge related entries and delete those lines.

Overtone answered 4/12, 2020 at 22:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.