Pin a batch file to the Start menu or taskbar in Windows 10

Sometimes you need to pin a batch file to the Start menu or taskbar in Windows. Unfortunately, the operating system doesn't allow you to do it out of the box. "Pin to Start" and "Pin to taskbar" context menu commands are missing in the context menu of File Explorer in Windows 10. Here is a quick workaround which will allow you to achieve the goal.


When you right click a batch file, you will see that the context menu does not contain the commands "Pin to Start" and "Pin to taskbar":
no pin context menu
As a workaround, you can create a shortcut with the following target:

cmd /c "path to your batch file"

This will execute the batch file and close the command prompt window. Double quotes are so that you can use long file names in the path.
If you use the following shortcut target:

cmd /k "path to your batch file"

Then the command prompt will remain open after the batch file finishes running.
When you right click such a shortcut, it will include the context menu commands to pin to Taskbar or Start!

Here is what you need to do.

  1. Right click on the Desktop and select the command "New -> Shortcut" from the context menu. Windows 10 new shortcut
  2. In the shortcut target, type the following text:
    cmd /c "full path to your batch file"

    In my example, it will be

    cmd /c "C:\Users\winaero\Desktop\test.cmd"

    shortcut target

  3. Name the shortcut and change its icon if you need: shortcut name
  4. Now, right click the shortcut and choose "Pin to Start" from the context menu: Windows 10 pin batch file to start

You are done. The result will be as follows: Windows 10 pinned batch file to start Windows 10 pinned batch file to start 2

That's it.

15 thoughts on “Pin a batch file to the Start menu or taskbar in Windows 10

  1. Bert McLees

    hmmm… still don’t get the option of pinning to start.. bat file works fine… ideas?

    Reply
    1. Sergey Tkachenko Post author

      Follow the instruction carefully. You shortcut should point to the cmd.exe file.

      Reply
    2. ruben

      Once you have the shortcut on your desktop, you can drag it to the taskbar.

      Reply
  2. Jeffrey Bue

    I tried this multiple times and {sigh} I can’t get it to work. The short cut gets created, but when I double-click it, the batch files doesn’t run… no errors… just doesn’t run.

    Reply
    1. Gabriel

      Try
      cmd /c “[path to batch].bat”
      instead of
      cmd /c “[path to batch].cmd”
      It worked for me.

      Reply
    2. Padraic

      Don’t use a .bat file – type the command straight into the shortcut.

      Reply
  3. Michael Wonderland

    Fast Easy solution: Rename your .bat file to .exe and then drag to task bar. Then right click the shortcut on the taskbar, select properties, and rename back to .bat .. and rename the original file back to .bat

    Reply
    1. Adrian

      I can confirm that this works, however it should be noted that you need to Shift+right click and not just right click.

      Reply
  4. Gustavo

    The bat file is not necessary. You can write the command directly in the “Type the location of the file” box of the shortcut creation wizard.
    Anyway, that is not enough. Right-clicking on the new shortcut still does NOT show the “pin to start menu” menú item. For that to happen you also have to:
    1) Move the shortcut to a subfolder of the “start menu” folder, which is located in “%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu”.
    2) Use the search box in the taskbar to find the shortcut
    Then, right-clicking on on the search result should show the “pin to start menu” item.

    Reply
    1. James

      Thanks. Worked like a dream!

      Reply
    2. Marcel Kincaid

      “The bat file is not necessary.”

      That’s nonsensical. This article is about how to pin a batch file.

      “You can write the command directly in the “Type the location of the file” box of the shortcut creation wizard.”

      What command? Again, this article is about how to pin a *batch file*. If you put the batch file location directly into the location, you can’t pin the shortcut … the whole point is that you need a .exe … cmd.exe for executing batch files.

      Reply
  5. Fear

    The most easy solution.
    Copy de direct acces to : C:\Users\[YOURUSER]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs

    Then, you will see the .bat in the windows menu, right click and “pin to start menu” :)

    Reply
    1. Chris

      Not seeing any .bat file in there!

      Reply
  6. Marcel Kincaid

    Thanks for this. Nowhere else mentions using cmd.exe, and most of the comments above are wrong, except the one about dragging the shortcut to the taskbar, which I needed because my shortcut doesn’t have “Pin to taskbar” in the context menu for some reason.

    Reply
  7. Chris

    It fails for me as well. There is a DOS window that flashes momentarily, but that’s about it.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.