I am trying to pin a program to the taskbar in Windows 10 (RTM) using this code:
$shell = new-object -com "Shell.Application"
$folder = $shell.Namespace((Join-Path $env:SystemRoot System32WindowsPowerShellv1.0))
$item = $folder.Parsename('powershell_ise.exe')
$item.invokeverb('taskbarpin');
This worked on Windows 8.1, but no longer works on Windows 10.
If I execute $item.Verbs()
, I get these:
Application Parent Name
----------- ------ ----
&Open
Run as &administrator
&Pin to Start
Restore previous &versions
Cu&t
&Copy
Create &shortcut
&Delete
Rena&me
P&roperties
As you can see, there is no verb for pinning it to the taskbar. If I right click that specific file, however, the option is there:
Questions:
Am I missing something?
Is there a new way in Windows 10 to pin a program to the taskbar?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…