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
- Open File Explorer.
- Go to the batch file you want to pin to the taskbar or Start menu.
- Right-click the batch file.
- On Windows 11, click Show more options.
- Point to Send to.
-
Click Desktop (create shortcut).

- Go to your desktop.
- Right-click the new shortcut.
-
Click Properties.

-
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.

- Click Apply.
- Click OK.
- To pin the batch file shortcut to the taskbar or Start menu, right-click the shortcut.
-
Click Pin to Start or Pin to taskbar. On Windows 11, click Show more options first.

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