[Windows] Pin batch file to Start Menu

You can pin executable file (.exe) or folder to Start Menu and Taskbar but you cannot do that to batch file. These are methods to make batch file appear in them:

Method 1: Create shortcut wizard
  1. In Desktop (or directory, folder), right-click on blank space to display Context Menu ➞ New ➞ Shortcut
  2. A Create Shortcut Wizard window will open
  3. Type this in text box:
    cmd /c "path/your_file.bat"

    Use /k instead of /c if you do not want console to close when file is executed successfully. You can run many commands at once by using & or && to separate between commands.

    cmd /c "path/your_file.bat" & ping google.com
    cmd /c "path/your_file.bat" && ping google.com

    -> use && if you want the commands to execute in order, the second will wait for the first to be executed successfully.

  4. Click Next
  5. Type your shortcut name
  6. Click Finish
  7. Now you have shortcut in Desktop. You can right-click on shortcut to pin it to Start Menu or Taskbar.

Method 2: Add your shortcut directly to Start Menu folder
  1. Right-click on your batch file to open Context Menu ➞ Send To ➞ Desktop (create shortcut)
  2. Now we have shortcut of your batch file on Desktop (ex: my_file.bat). We will move it to this folder C:\Users\<your-account-name>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs.
  3. Your shortcut will appear in Start Menu, though it will not be on the tile layout, but on the left sidebar of list app.
  4. If you want to change to a tile, you can use this tip.
    1. Right-click on your shortcut in Desktop, open Context Menu➞ Properties.
    2. You changes Target textbox to cmd then click OK. Now your shortcut links to cmd.exe, so you can right-click and be able to pin it to Start Menu.
    3. Your shortcut will appear in C:\Users\<your-account-name>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs, you can do that again for this shortcut to change Target to your batch file.

Reference: Winaero