You cannot pin the batch file itself, but you can pin a shortcut that invokes the batch file (using cmd.exe).

  1. create a shortcut to the batch file
    • right click and drag the batch file
    • drop it anywhere
    • click “create shortcut here”
  2. edit the shortcut to launch your batch via cmd.exe
    • right click the newly created shortcut
    • click properties
    • set the “Target” field to something like C:\Windows\System32\cmd.exe /c C:\MY_BATCH_FILE.bat
      • IMPORTANT: be sure to replace the C:\MY_BATCH_FILE.bat part above with the path to your own batch (the batch you wanted to pin)
  3. pin the shortcut (right click then pin to start or taskbar)

Obviously when the shortcut is launched, it will use cmd.exe to launch your batch file :)