Gundark / TaskbarUnpinner

Remove unwanted shortcuts from the Windows Taskbar
GNU General Public License v3.0
4 stars 0 forks source link

Doesn't Unpin "Microsoft Edge" or "Microsoft Store" #2

Open Zamiell opened 6 years ago

Zamiell commented 6 years ago

By default, Windows 10 Professional comes installed with 4 things pinned to the Taskbar: 1) "Show Task View" 2) "Microsoft Edge" 3) "File Explorer" 4) "Microsoft Store"

I ran this VBS script on a freshly installed Windows 10 with the hope that it would unpin all 4 of these things, but unfortunately it only unpinned #3 (the "File Explorer).

After taking a look at the script, I tried to modify it slightly by changing the line:

stringContains(itemName, "Internet Explorer") OR _

to:

stringContains(itemName, "Microsoft Edge") OR _

And I also added a line for "Microsoft Store" as well. After that, I ran the script again, but Microsoft Edge and Microsoft Store were not actually unpinned. Any tips?

Zamiell commented 6 years ago

An alternate method that I found from the following page: https://social.technet.microsoft.com/Forums/office/en-US/a343b660-452c-4ca4-ade1-ae972c52f4be/windows-10-remove-unpin-edge-from-startmenu-und-taskbar-with-a-script?forum=w7itprogeneral

I'm in the same boat as you, it seems. I have figured out how to remove Edge from the taskbar, but only by nuking the entire taskbar: In my win10 GPO, I have configured a User GPP to run once and delete HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband. So it deletes it on the first logon. The registry path is automatically recreated, so no long term harm.

So, in a PowerShell script, I do:

# Unpin the other default taskbar icons by nuking the entire Taskbar entry in the registry
# From: https://social.technet.microsoft.com/Forums/office/en-US/a343b660-452c-4ca4-ade1-ae972c52f4be/windows-10-remove-unpin-edge-from-startmenu-und-taskbar-with-a-script?forum=w7itprogeneral
REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband" /F

# The above above changes require a restart of explorer to take effect
taskkill /f /im explorer.exe
start explorer.exe
Gundark commented 6 years ago

Zamiell ... my installation was customized by the IT group where I work, so I didn't have the same items to unpin that you found on a fresh install. But I think this may still be doable with this tool. The key that I found was to find the right namespace to search for the pinned item, which is why the VBS runs against several namespaces. Windows 10 doesn't appear to keep all pinned items in the same namespace.

This, and other related topics are discussed in depth on the page where I got the basic idea for this script: https://pinto10blog.wordpress.com/2016/09/10/pinto10/. It is worth a read. There are links to several other useful tools there.

To paraphrase my last comment on that page, "I used File Explorer to find all shortcuts to File Explorer on my C: drive. Then right clicked on them until I found one that had the ‘Unpin’ verb." Then I used the location of that instance as the namespace for unpinning in the code. This approach might work for you as well for MS Store and Edge. I would volunteer to try it, but because my system doesn't have those things pinned by default, it wouldn't be a useful test.

Also, thanks for the contribution, I've merged it.

Gundark commented 6 years ago

I found that the shell:AppsFolder namespace has the 'unpin from taskbar' verb for both MS Store and MS Edge. So I added that back in, along with the strings for both. It works on my system if I manually pin those to the taskbar. Give it a shot and see if it works for the defaulted icons as well.

'Show Task View' appears to be a built-in feature of the taskbar. Since I wrote Unpin specifically for pinned apps on the taskbar, toggling the 'Show Task View' feature isn't a good fit for Unpin.

However, I found this batch file with a registry hack that may do what you want -- I can't recommend it personally because I haven't tried it. If that registry hack does work, putting it in a batch file along with a call to Unpin.vbs would give you a single process that would remove all the things you don't want.