-
Notifications
You must be signed in to change notification settings - Fork 904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Install-ChocolateyPinnedTaskBarItem does not pin and unpin from task bar in Windows 10 #627
Comments
@chocolatey/developers does anyone remember who worked on this one? |
Do you need log or debug? I can reproduce them. |
@erotavlas85 that is helpful - if you save it as a gist and provide the link, that would be helpful. |
While I dont recalll this being a problem in win 7, I have noticed that pinning is broken in win 10 and need to research why. Adding this to my to do list but might be a wek or so before I get to it. |
I've added this to the backlog and assigned it to you. If you get to it in time for 0.9.10, great! We can update the milestone. :) |
This is the output log gist link https://gist.githubusercontent.com/erotavlas85/a92ac6974212882ecf17/raw/c7b71db8ac1bccfbb10f20b11410856cb338cf9a/log.sh |
A possible solution to unpin all is the following Remove-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband" -recurse Get-Process explorer | Stop-Process` |
Any news? |
Did a bit of research on this. It turns out that according to MSDN "A small set of applications are pinned by default for new installations. Other than these, only the user can pin further applications; programmatic pinning by an application is not permitted.". This concurs with a blog post from Raymond Chen - "there is no PinToTaskBar function". So basically any technique to achieve this is unsupported - which is probably why it stopped working in Windows 10. I came across a comment on an issue in another repo related to the same problem where they figured out that "Pin to task bar" verb is no longer being returned. But then after all that they apparently managed to figure out another workaround that does work in Windows 10. So if you can read this code, and figure out what it is doing, it might be possible to do the same in PowerShell |
The interesting bits are the DWORD at lordmulder/stdutils@839107d#diff-994c180910d9ef09478cfe0e8e854b98R723 |
There may also be bits in those compiled DLLs they included. |
Not supported by windows 10 any longer chocolatey/choco#627
There is a small program to do this described here. The source code is included although I don't see a license. |
Any news on adding support for this in win10? |
Hi, there is PowerShell snippet that works pretty well. |
Confirming that works. Here's a tidied up version (with Param($Target)
$ValueData = (
Get-ItemProperty("HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Windows.taskbarpin")
).ExplorerCommandHandler
$classesStarKey = (Get-Item "HKCU:\SOFTWARE\Classes").OpenSubKey("*", $true)
$shellKey = $classesStarKey.CreateSubKey("shell", $true)
$specialKey = $shellKey.CreateSubKey("{:}", $true)
$specialKey.SetValue("ExplorerCommandHandler", $ValueData)
$specialKey.Close()
$Shell = New-Object -ComObject "Shell.Application"
$Folder = $Shell.Namespace((Get-Item $Target).DirectoryName)
$Item = $Folder.ParseName((Get-Item $Target).Name)
$Item.InvokeVerb("{:}")
$shellKey.DeleteSubKey("{:}")
if ($shellKey.SubKeyCount -eq 0 -and $shellKey.ValueCount -eq 0) {
$classesStarKey.DeleteSubKey("shell")
}
$shellKey.Close()
$classesStarKey.Close() |
Hi all. There is also tool which we use to automate the process of pinning Office 2016 and 2019 Icons to the taskbar of windows 10 (release 1809. Which is actually the most recent release). The website http://www.technosys.net/ --> Products --> Utils --> PinToTaskbar (syspin.exe). We install office product and write in cmd (as admin): The tool works fine. Anyway this is not a programmatic solution which was provided just above and it not suited for this particular choco case.. but anyway this might help some people which look for an easy way to pin the ofice icons to the taskbar. |
Is it me or is this not working for Windows 10 1903? |
@DavidNgoDev which thing in particular are you referring to as not working? |
|
|
@flcdrg The code you posted works fine for admins (which is how most packages install anyway), but I didn't get it to work for non-admins. Here is some alternative code that works for both.. I think it only works for applications that are already in the Start Menu programs list, although it's easy enough to create an icon in Edit: Oops! This is for pinning to the Start Menu which I should have noticed is not the point of this issue. It does not appear to work for the taskbar. (At one time, the code for pinning to Start and pinning to taskbar were nearly identical. MS blocked Start menu pinning via code, and this is the first time since that I have seen it work.) Sorry for the distraction. |
@teknowledgist That script talks about pinning to the start menu - does it pin to the task bar though? |
For instance
I modified the source code of Install-ChocolateyPinnedTaskBarItem in order to print all the operations and this is the output
Am I making a mistake on calling the function?
Moreover, I would like also to unpin programs. It seems that chocolatey does not have any function to do this. I found from this thread How to unpin "Library" folder from Task Bar using Powershell? this function that is the complementary of the previous pin function.
In the same way this does not work. I know that I can use other solutions like this https://gallery.technet.microsoft.com/ScriptCenter/b66434f1-4b3f-4a94-8dc3-e406eb30b750/. However, I prefer to use all stuff from chocolatey. Do you have any suggestions?
UPDATE: We would only support this on supported operating systems which, on the client side, would be some Windows 10 and 11.
The text was updated successfully, but these errors were encountered: