Pining a .BAT/.CMD File to Taskbar

When a .BAT file or a shortcut pointing to a .bat file is opened, we will not find an option to "Pin the program to taskbar”; and we can’t neither drag nor drop the file to the taskbar.


The .CMD file has the same behavior as the .BAT file.




Please perform the following steps to pin a .BAT/.CMD file to taskbar:


1.      Pin a shortcut for cmd.exe to the taskbar.


2.      Right click the shortcut on the taskbar and you will see a list that includes "Command Prompt" and "Unpin this program from the taskbar".


3.      Right click the icon for Command Prompt and select properties.


4.      In the box for Target, go to the end of "%SystemRoot%\system32\cmd.exe" and add "/C" (without quotations) and the path and name of the batch file.


5.      Then the batch file will be pinned to the taskbar.


For .CMD files, you also can try the same procedures.

Comments (12)
  1. Rich says:

    This method works well for a single file. Unfortunately it won't let you pin multiple files. Is there any way to do that?

  2. Bmarley1 says: a simple application which you can pin to your taskbar that will then allow you to pin batch files to it.

  3. Bill dickson says:

    That doesn’t make any sense. you can’t add /C to the end of a .exe, Adding an additional path to the end of that, especially one thats something like C:/windowsetc makes even less sense. You are talking out of your ass.

  4. claudio says:

    This worked like a champ, thanks…
    %windir%system32cmd.exe /C C:UsersClaudioDownloadsPingTest.bat

  5. Sean says:

    Worked extremely well, and for the confused, /c is a command line switch for cmd.exe to tell it to launch a command shell for the .bat/.cmd file to be executed in… Post no Bills…

  6. Ron says:

    Yep, worked as advertised. If you want to change the icon of the link, make sure you do it before you pin it to the taskbar.

  7. Leo Jacob says:

    Doesn’t work. Not ever a little bit.

  8. PatRick says:

    No, it does not work unless someone is in error about spacing IN the TARGET line, but:
    C:WindowsSystem32cmd.exe /C C:Program Files (x86)xxxxxyyy.bat
    Just blinks at you. This BAT if executed as a BAT file, runs TWO programs, one after the other perfectly
    Something is missing.

  9. Billy says:

    add quotations to paths containing spaces!

  10. Craggers says:

    Follow Patrick’s comment. The correct spacing is needed. I’ve just added a .BAT to taskbar, works perfectly. Cheers Patrick 🙂

  11. The Quick White Fox says:

    Works perfectly, thank you. This works for several shortcuts as well, not just one. For every shortcut you intend to use just make an additional command prompt shortcut and apply the command instructed above. Reading the directions usually points to success
    for future reference to those of you claiming "this does not work". First attempt with flying colors, thank you again.

  12. lloyd says:

    Works well. Make sure you leave a space after cmd.exe.
    ie. …cmd.exe /c C:Program Files…filename.bat

Comments are closed.

Skip to main content