I am using this script to create a shortcut for IE:
$TargetFile = "$env:ProgramFiles\Internet Explorer\iexplore.exe" $ShortcutFile = "$env:Programdata\Microsoft\Windows\Start Menu\Programs\Internet Explorer.lnk" $WScriptShell = New-Object -ComObject WScript.Shell $Shortcut = $WScriptShell.CreateShortcut($ShortcutFile) $Shortcut.TargetPath = $TargetFile $Shortcut.Description = "Finds and displays information and Web sites on the Internet." $Shortcut.WorkingDirectory = "%HOMEDRIVE%%HOMEPATH%" $Shortcut.Save()
The code works fine and creates the shortcut, but if this shortcut is pinned to the taskbar via the “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\TBDEn” /v SBOEM0" reg key, IE instances do not stack. What I mean by that is if you click on the icon on the taskbar, a new icon on the taskbar appears with the open window along with the pinned item so there are now to IE icons side by side until I close IE. When I copy the actual link file instead of creating it, it exhibits normal expected behavior ( i.e all open programs stack in the taskbar).
I noticed that the icon created via powershell is a little smaller in size than the one auto created by windows.
Is there a way to view all the ComObject properties of an existing WScript.Shell object in powershell so that I can copy the missing attributes?