How to pin a batch file to the taskbar or Start menu in Windows 10 or 11

Windows won't let you pin a batch (.bat) file to the taskbar or Start menu directly. You need a shortcut that opens the file through the command prompt (cmd /c). This page shows how to create that shortcut.

ADVERTISEMENT

Pin a batch file to the taskbar or Start menu

  1. Open File Explorer.
  2. Go to the batch file you want to pin to the taskbar or Start menu.
  3. Right-click the batch file.
  4. On Windows 11, click Show more options.
  5. Point to Send to.
  6. Click Desktop (create shortcut).
    Create batch file desktop shortcut
  7. Go to your desktop.
  8. Right-click the new shortcut.
  9. Click Properties.
    Batch file shortcut properties
  10. In the Target field, wrap the path in quotation marks, then type cmd /c and a space in front of it (e.g., cmd.exe /c "C:\Users\MX\Documents\CMD.bat"). This tells Windows to run the file through the command prompt instead of opening it in Notepad.
    Batch file shortcut target
  11. Click Apply.
  12. Click OK.
  13. To pin the batch file shortcut to the taskbar or Start menu, right-click the shortcut.
  14. Click Pin to Start or Pin to taskbar. On Windows 11, click Show more options first.
    Pin a batch file to Windows 10 or 11 start menu or taskbar

The shortcut is now pinned. You can delete it from the desktop.

ADVERTISEMENT

Related:

How to pin a folder to the taskbar in Windows 10 and 11

How to stop taskbar icons from flashing in Windows 11

How to customize the Windows 11 taskbar

How to fix missing or blank taskbar icons in Windows 10 & 11

How to automatically hide the taskbar in Windows 10 and 11


Windows