worked for me, I wrote up a quick ditty how I did it in Windows 7 for pinned stuff: http://vivithem
age.com/2015/12 /22/running-a-p owershell-comma nd-via-batch-or -command-that-i s-restricted/
I am trying to use this in an environment where we are migrating from office 2010 to 2013 and to Notes 9 on windows 7. I would like to have it simply unpin Notes and the Pin Notes and word, excel and Powerpoint. If any of these already exist and I try to pin them the script/module errors and exits, if they dont exist and I try to unpin them it does the same with the verb not found error. Has anyone managed to get some form of error checking going in this? or managed to get it to check if a application is already pinned to skip and carry on instead of erroring out?
Wow this is a great script! I would really like to use it on Windows 8. But each time I do I get the following error: PS C:\> Set-PinnedAppli
cation -Action UnPinFromStartM enu -FilePath “C:\WINDOWS\sys tem32\notepad.e xe” Exception calling “DoIt” with “0″ argument(s): “The parameter is incorrect. (Exception from HRESULT: 0×80070057 (E_INVALIDARG)) ” At C:\PinnedApplic ation.psm1:67 char:13 + $itemVerb.DoIt( ) + ~~~~~~~~~~~~~~~ ~ + CategoryInfo : NotSpecified: (:) , MethodInvocatio nException + FullyQualifiedE rrorId : ComMethodTarget Invocation This happens whether I’m calling the UnPinFromStartM enu OR PinToStartMenu actions… Anybody have any ideas how to get it to run on Windows 8?
I've got the same error message on Windows Server 2012 R2. Do you get a solution since you posted this message ?
Hello ! I'm getting errors. PS C:\> Set-PinnedAppli
cation -Action PinToStartMenu -FilePath "C:\Windows\Sys tem32\notepad.e xe" Exception lors de l'appel de «DoIt» avec «0» argument(s): «Paramètre incorrect. (Exception de HRESULT : 0x80070057 (E_INVALIDARG)) » Au caractère C:\temp\PinnedA pplications.psm 1:67 : 13 + $itemVerb.DoIt( ) + ~~~~~~~~~~~~~~~ ~ + CategoryInfo : NotSpecified: (:) , MethodInvocatio nException + FullyQualifiedE rrorId : ComMethodTarget Invocation The script is executed on a Windows Server 2012 R2.
I'm getting errors. Get-Command -Module PinnedApplicati
ons CommandType Name Version Source ----------- ---- ------- ------ Function Set-PinnedAppli cation 0.0 PinnedApplicati ons PS C:\Users\admini strator> Set-PinnedAppli cation -Action PinToTaskbar -FilePath C:\Windows\syst em32\notepad.ex e Verb Pin to taskbar not found. At \\insight-dc3\n etlogon\ps1\Pin nedApplications .psm1:65 char:13 + throw "Verb $verb not found." + ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~ + CategoryInfo : OperationStoppe d: (Verb Pin to taskbar not found.:String) , RuntimeExceptio n + FullyQualifiedE rrorId : Verb Pin to taskbar not found.
There are some issues making it work in Windows 10, details here: https://connect
.microsoft.com/ PowerShell/feed back/details/16 09288/pin-to-ta skbar-no-longer -working-in-win dows-10
I keep getting the "verb not found error" and the suggestions listed did not help. It only seems to happen with .lnk files for me and not .exe files. Alternatively, if I could pin an exe with an argument after the target file that would work.
I have a couple programs that i can pin by holding shift and right clicking the icon to pin to start menu. I was able to get your script to work for all applications except for those. How can I get the script working for icons that require you to hold shift to pin when using the mouse?
Hi, Amazing script. Having some problems when i want to add the file explorer link. Set-PinnedAppli
cation -Action PinToTaskbar -FilePath "\\npcloud\tsas p\HorizonStartM enuASP\Programs \File Explorer.lnk" I am getting an error on line 65, char 13 on the orignal script. Error: Verb Pin to Taskbar not found. At line:65 char:13 + throw "Verb $verb not found." + ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~ + CategoryInfo : OperationStoppe d: (Verb Pin to Taskbar not found.:String) , RuntimeExceptio n + FullyQualifiedE rrorId : Verb Pin to Taskbar not found. Thanks for help Jone
Jan, Amazing script! I really like. I find myself forgetting which actions are available so I made a small modification to 1 line to ensure greater success. [Parameter(Mand
atory=$true)][V alidateSet("Pin toStartMenu","U npinfromStartMe nu","PintoTaskb ar","UnpinfromT askbar")][strin g]$Action Hope this helps! Thanks, Ben
Hello, The scripts can work on Win7.But I want to use it on Win8.On Win8 Pin to taskbar can work correctly,but pin to start menu has error. By the way,On Win8,how can i pin(Upin) a EXE file on start screen(Metro) UI? Any suggestions? Best Regards Eric
Hello All Can some one check this script and tell me why it is not working on Windows 7. I used a Windows 8 PC to do the script and test it and it work properly. The script basically unpin the Mozilla Firefox from task bar for all users. Thanks. Sub ShowFolderList(
folderspec) on error resume next Dim fs, f, f1, fc, s Set objShell = CreateObject("S hell.Applicatio n") Set objFSO = CreateObject("S cripting.FileSy stemObject") Set fs = CreateObject("S cripting.FileSy stemObject") Set f = fs.GetFolder(fo lderspec) Set fc = f.SubFolders For Each f1 in fc REM wscript.echo "Here is all the sub folders : " & f1.name strFileName = objFSO.GetFileN ame(f1) REM wscript.echo "value of strFileName is : = " & strFileName Set objFolder = objShell.Namesp ace("C:\Users\" & strFileName & "\AppData\Roami ng\Microsoft\In ternet Explorer\Quick Launch\User Pinned\TaskBar" ) Set objFolderItem = objFolder.Parse Name("Mozilla Firefox.lnk") Set colVerbs = objFolderItem.V erbs For Each objVerb in colVerbs If Replace(objVerb .name, "&", "") = "Unpin from Taskbar" Then objVerb.DoIt REM wscript.echo " Unpin successfully for user : = " & strFileName else REM wscript.echo " There is nothing to Unpin for user : = " & strFileName end if Next Next End Sub showfolderlist "C:\Users"