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":
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.
- Right click on the Desktop and select the command "New -> Shortcut" from the context menu.
- 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"
- Name the shortcut and change its icon if you need:
- Now, right click the shortcut and choose "Pin to Start" from the context menu: