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.

  • I am pretty sure by default IE is already pinned to the taskbar are you sure its even required to pin iexplore.exe? – Ramhound Dec 4 '14 at 20:17
  • The issue we have is that some computers automatically pin the wrong icons to the taskbar on logon, and we have issues with invalid shortcuts on some machines. This batch file is part of two scripts - one of which wipes all taskbar shortcuts and the reg key. This script then re-pins them. – TeknoVenus Dec 4 '14 at 20:19
  • I also don't think this is a duplicate, and the solution posted there doesn't work in my scenario. – TeknoVenus Dec 4 '14 at 20:20
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)

  • Thanks - but still no joy I'm afraid. Pinning a shortcut of %SystemRoot%\explorer.exe shell:MyComputerFolder will still cause a new explorer icon to appear on my taskbar when I click it. – TeknoVenus Dec 4 '14 at 22:57

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.