Can't pin modified shortcuts to the Windows 7 taskbar

I have a shortcut to a .bat file which I pin to the task bar using a workaround by using another icon and this seems to work. Now I make a copy of that shortcut, point it to a different .bat file, rename it, and I can't pin this one to the task bar. I have to find some other new unused icon to pin, pin it, then modify it manually. The other problem this causes is that Windows seems to track which icons were pinned even if they are modified after the fact. As such, if I use media player as my dummy icon, pin it, then alter it's name and shortcut to point to a .bat file, I can't re-pin Windows media player and if I select unpin from the Windows media player, it unpins my shortcut to my .bat file.

I can't believe how ridiculous this is. Is there a way to pin anything I want to the taskbar (ie. .bat file in my case) that does not cause problems like this?

Is there an easy way I can copy an existing shortcut and modify it and re-pin it to the taskbar? The reason I want to copy it is because I start a .bat file (in particular git bash) and I set properties on the window like quick edit, increase the screen buffer and set it's position and size manually. I don't want to have to do this to every single icon I want to pin since they will be identical aside from the shortcut url.


Solution 1:

Two rules:

  • Only applications can be pinned to the task bar.
  • Files can be pinned to applications

Two solutions:

  • Create applications that start your batch files, but that would be a stupid work-around.
  • Pin your Command Prompt to your task bar and pin your batch files to that Command Prompt.

Solution 2:

I have a method which might work for what you are trying to accomplish.

There are a few steps to follow, so here it goes:

  1. Make sure you can view file extensions.
  2. On your file to pin to the Taskbar, rename the extension to .exe
  3. Drag the file to the taskbar to pin it or Right-Click and "Pin to Taskbar"
  4. Rename the file extension back to .bat.
  5. On the pinned file, right-click on the icon, this should bring up the jump list. Right-click again on the file itself and select properties.
  6. On the properties, change the file extension on the target to .bat from .exe.
  7. (Optional) Change the icon to your liking.

Now when you click the taskbar icon, it will open your batch file. This will work for pretty much any file, it just has to be an .exe to pin it initially. Also you will need to keep the original file somewhere where it can link to.