Originally Posted By: Allen
...I am surprised it works at all using the path of the exe and not the link itself.

That is interesting, I didn't think of using the shortcut. Using vbscript anywhere, or using kixtart on 32-bit servers, I've had no issues with the samples I posted above.

 Originally Posted By: Allen
This hasn't been tested a lot, but worked in my initial tests on a Win 7 x64. If it doesn't work, it's possible I have the @producttype wrong. I do not have any R2 servers to test on. So let me know.

UnPinFrom() - http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=201410&Main=27133#Post201410

FYI, @ProductType returns "Windows Server 2008 R2 Enterprise Edition" in my case, so your syntax is ok there.

After thinking about this a little more, I like the idea of unpinning from the start menu and including .lnk in the shortcut name as options. Languages other than English are not an issue for me.

Here's what I'm using with those changes considered:
 Code:
$objApp = CreateObject("Shell.Application")
$objFSO = CreateObject("Scripting.FileSystemObject")

UnPin("Windows PowerShell","Taskbar") ;Unpin PowerShell from the taskbar

;************************Start of UnPin()
Function UnPin($ShortcutName,$StartMenuOrTaskbar)
	;Unpins from the start menu or taskbar the program who's shortcut name is provided
	;Syntax:	UnPin(<shortcut name>,<"Start Menu" | "Taskbar">)
	;Example:	UnPin("Windows PowerShell","Taskbar") ;Unpin PowerShell from the taskbar
	If $StartMenuOrTaskbar = "Start Menu"
		$ShortcutPath = %AppData% + "\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu"
		$Verb = "Unpin from Start Menu"
	EndIf
	If $StartMenuOrTaskbar = "Taskbar"
		$ShortcutPath = %AppData% + "\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar"
		$Verb = "Unpin from Taskbar"
	EndIf
	If LCase(Right($ShortcutName,4)) <> ".lnk"
		$ShortcutName = $ShortcutName + ".lnk"
	EndIf
	If $objFSO.FileExists($ShortcutPath + "\" + $ShortcutName)
	    $objFolder = $objApp.Namespace($ShortcutPath)
	    $objFolderItem = $objFolder.ParseName($ShortcutName)
	    $colVerbs = $objFolderItem.Verbs
	    For Each $objVerb in $colVerbs
		If Replace($objVerb.name,"&","") = $Verb
			$objVerb.DoIt
		EndIf
	    Next
	EndIf
EndFunction;<==UnPin()
;************************End of UnPin()


Thanks,