#PowerShell script to pin item in StartMenu #User must input full name of file (.exe) (for example C:\Program Files\KDWin\KDWin.exe) $Path = Read-Host " Input file full name [for exaple C:\Windows\Notepad.exe ] " $objSh = New-Object -ComObject Shell.Application $locobj = $objSh.NameSpace(0X0) $FileName = Split-Path -Path $Path -Leaf $f=0 try { $Verbs = $locobj.ParseName($Path).Verbs() Foreach($verb in $Verbs) { If($verb.Name.Replace("&","") -match "Pin to Start") { $verb.DoIt() $f = 1 } } Switch ($f) { "0" { Write-Host "The ""$FileName"" cannot pin to the Start menu." -ForegroundColor Red} "1" {Write-Host "Pin ""$FileName"" to the Start menu sucessfully....." -ForegroundColor Yellow} } } catch { Write-Host "Incorrect Input !!! Item is not exist or can not pin to StarMenu!!!" -ForegroundColor Red } sleep(30)