0

I'm trying to find a way to correctly pin Windows Explorer to the taskbar using GPO. I am currently using a batch file to automatically pin various icons to the user's taskbar at logon as per: http://www.blackforce.co.uk/2014/01/23/how-to-pin-programs-to-windows-8-taskbar-using-group-policy-preferences-gpo.

This is my batch file:

cscript PinItem.vbs /taskbar /item:"%windir%\explorer.exe"
cscript PinItem.vbs /taskbar /item:"C:\Program Files\Internet Explorer\iexplore.exe"
cscript PinItem.vbs /taskbar /item:"C:\Program Files\Microsoft Office\Office15\Outlook.exe"
cscript PinItem.vbs /taskbar /item:"C:\Program Files\Microsoft Office\Office15\WINWORD.exe"
cscript PinItem.vbs /taskbar /item:"C:\Program Files\Microsoft Office\Office15\EXCEL.exe"
cscript PinItem.vbs /taskbar /item:"C:\Program Files\Microsoft Office\Office15\POWERPNT.exe"
cscript PinItem.vbs /taskbar /item:"C:\Program Files\Microsoft Office\Office15\ONENOTE.exe"

This is fine, and works perfectly for everything except for explorer.exe. Explorer will pin to the taskbar but when you click the actual icon a new icon for explorer will appear.

It's quite easy to reproduce this:

  1. Right click on your desktop and create a new shortcut
  2. Set the path to %windir%\explorer.exe, C:\Windows\Explorer.exe or similar
  3. Drag and drop that shortcut to your taskbar and unpin File Explorer if it's already pinned.

You will find that when you click this new icon, a second icon will appear beside it.

I've tried doing traces with ProcMon, but not seen anything helpful. That said, I'm not the most experienced with it.

Any suggestions? This is using Windows 8.1.

Update: Shortcuts are stored in %APPDATA%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar. If I create two explorer shortcuts - one via the method earlier in my post and one normally (right click -> pin), I see that they have completely different file sizes.

The explorer.exe shortcut I made is 4,096 bytes and the "pin to taskbar" one is 407 bytes.

Update 2 Tested on a Windows 7 machine - the script works as intended. However, it actually stops you dragging and dropping the shortcut to the taskbar, which windows 8 doesn't.

1 Answers1

0

The reason explorer is opening a second instance, is because explorer is also used as your shell. To correctly make this work, you have to set startup options for explorer as well.

Change it to this: %SystemRoot%\explorer.exe shell:MyComputerFolder

Optionally, you can replace the shell:MyComputerFolder to any folder you wish the icon to start in. Usually people want to start in their "My Computer" folder, which is why I chose that folder. (works in windows 7 and higher)

LPChip
  • 66,193