我正在尝试将程序固定到 Windows 10 的开始菜单
$shell = New-Object -ComObject "Shell.Application"
$Folder = $shell.NameSpace("C:\Test")
$exe = $Folder.ParseName("notepad.exe")
#$exe.Verbs()
$ItemVerbs = $exe.Verbs()
Foreach($ItemVerb in $ItemVerbs)
{
If($ItemVerb.Name.Replace("&","") -match "Pin to Start")
{
$ItemVerb.DoIt()
Write-Host "Pin to the Start menu sucessfully.+ ""$ItermVerbTxt"" " -ForegroundColor Green
}
}
执行此代码后,我看到成功消息,这意味着它正在找到所需的动词。
但我在开始菜单中看不到 notepad.exe 磁贴。
请帮忙