Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
    
It's unclear what your workaround is. There is no limit on icons as I could give two applications the same icon and pin them both. Also, why do a workaround on a workaround... –  Tom Wijsman Mar 14 '11 at 16:24
    
Was this pre windows7sp1? I installed sp1 today and it actually removed my multiple pins and left me with only one firefox profile what the hell! So i see why you would be annoyed. I always used git bash by right clicking a folder. Its not a pin but its pretty convenient –  acidzombie24 Apr 1 '11 at 23:57
    
Whats weird is i can right click a shortcut and pin it. The taskbar is glitchy (the task opens where the first firefox icon/shortcut is and the one i open appears to be closed) but 'it works'. Also you can see my question superuser.com/questions/265558/… –  acidzombie24 Apr 2 '11 at 1:58
add comment

2 Answers

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.
share|improve this answer
    
Thanks for the suggestions, but i need them pinned as normal applications. I have gotten this to work with the manual workaround already, it's just that it suffers from the limitations i listed above. Also is there a way to disable the recently used list for things like windows explorer pinned to the task bar? –  Coder Mar 14 '11 at 15:34
    
@Coder: Welcome to Super User! If you have another question like "disabling the recently used list", please ask it by clicking the Ask Question button. I've updated my answer slightly, you will either need to create your own application launchers or do it properly by using a shortcut to git-bash.exe on which you do quick edit, increase the screen buffer and set it's position and size manually. The quickest way would be to start git-bash.exe, adjust the settings and then in the task bar right click git-bash.exe and pin it. –  Tom Wijsman Mar 14 '11 at 15:39
    
Ok so basically windows 7 doesn't support it. I understand what you mean but it's very limiting. I would also argue that "doing it properly" you could just make a shortcut to a .bat file as git comes with a bat file which does a lot of initialization and i can't just point it to git-bash.exe. Also even if i could i couldn't pin two shortcuts which start in different directories because you can't pin the same shortcut twice i believe. correct me if i'm wrong. –  Coder Mar 14 '11 at 15:47
    
@Coder: Windows 7 does support pinning applications, and Git does provide one namely C:\Program Files\Git\bin\sh.exe, you can pass settings and parameters along, I don't see where your problem lies? There is no such thing as pinging shortcuts to batch files, you either pin applications or pin files supported by those applications to those applications. Why would you apply an icon workaround onto a batch workaround if you could use the application straight-away, why make a batch equivalent of the shortcut you actually want to have? –  Tom Wijsman Mar 14 '11 at 15:59
    
i can't use the application straight away. I'm using MSysGit and it's started by running "git-bash.bat" which does inisitalization, if you take a look at it, it has a bunch of if statements. Besides pointing to the exe files still prevents me from pinning two or more shortcuts (which i want to do, 3 actually) which start in different working directories. Ie. i just verified that you can't pin two shortcuts to the same exe. Windows prevents it. –  Coder Mar 14 '11 at 16:11
show 1 more comment

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.

share|improve this answer
    
thanks for the suggestion, unfortunately when i click on my pinned shortcut it launches the app as a new item on the bar. Ie. it doesn't bind the running application to the pinned shortcut, it makes a new icon for it (which is not pinned). I hope i explained this right but i need the behaviour where the running program uses the pinned icon while it's running (unfortunately this solution does not work for this). –  Coder Sep 8 '11 at 1:15
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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