pin batch file to taskbar


  1. Posts : 298
    Win10 10.0.18362 Build 18362
       #1

    pin batch file to taskbar


    i have created a batch file on my desktop

    when i right click on batch it dont show option to pin to taskbar

    when i am running this batch files, i pin it to taskbar

    however after terminating the batch file when i click on taskbar icon to run batch file

    it open command prompt instead of batch file

    - - - Updated - - -

    pin batch file to taskbar-screenshot-4-.png
    Attached Thumbnails Attached Thumbnails pin batch file to taskbar-bat-file-pin-taskbar.jpg  
      My Computer


  2. Posts : 16,949
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #2

    Create a shortcut to the batch file.
    Right-click on the shortcut, Properties, write into the start of the target field explorer.exe [Windows will later change that automatically to C:\Windows\explorer.exe and this is not a problem]
    pin batch file to taskbar-target-field.png
    Then right-click on the shortcut and select Pin to taskbar

    Denis
    Last edited by Try3; 05 Apr 2020 at 08:17.
      My Computer


  3. Posts : 298
    Win10 10.0.18362 Build 18362
    Thread Starter
       #3

    Try3 said:
    Create a shortcut to the batch file.
    Thanks Try3

    but i also tried c:\windows\system32\cmd.exe c:\users\hp\desktop\test.bat

    it didnt work
      My Computer


  4. Posts : 17,838
    Windows 10
       #4

    Put the .bat file somewhere stationary, change it to a .exe, drag and pin it to Taskbar, change the file back to .bat, change the pinned shortcut back to .bat, restart Explorer.

    pin batch file to taskbar-000286.png
      My Computer


  5. Posts : 16,949
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #5

    makhan10 said:
    Thanks Try3

    but i also tried c:\windows\system32\cmd.exe c:\users\hp\desktop\test.bat

    it didnt work
    Exactly what did you do, exactly what did not work and exactly what did happen?
      My Computer


  6. Posts : 298
    Win10 10.0.18362 Build 18362
    Thread Starter
       #6

    Try3 said:
    Exactly what did you do, exactly what did not work and exactly what did happen?


    i type c:\windows\system32\cmd.exe C:\Users\hp\Desktop\test.bat in test.bat short cut properties

    it open command prompt at following location instead of running batch file

    c:\users\hp\desktop
      My Computer


  7. Posts : 16,949
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #7

    I said
    Code:
    explorer.exe C:\Users\hp\Desktop\test.bat
    or
    Code:
    explorer.exe C:\Users\Aziz\Desktop\test.bat
    and the batch file will run. This is what lots of us do.
    -
    The shortcut will automatically use the real path-name of the batch file. Do not change that. Just add explorer.exe in front of that.

    It does not apply in this case but if your username or any other part of a file path-name contained any spaces then you would enclose the whole path-name in quotation marks
    Code:
    explorer.exe "C:\Users\hp\Desktop\test.bat"

    Denis
      My Computer


  8. Posts : 298
    Win10 10.0.18362 Build 18362
    Thread Starter
       #8

    i also found another way to accomplish the same thing thnx to google

    pin batch file to taskbar - Google Search
      My Computer


  9. Posts : 16,949
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #9

    Yes,
    Code:
    cmd /c C:\Users\hp\Desktop\test.bat
    works as well as the explorer method does & as well as Edwin's suggestion does.

    Denis
      My Computer


  10. Posts : 97
    Win10 Pro, Version 21H2 (Build 19044.1706) (14.06.2022)
       #10

    I found another way:

    1. Rename your .cmd/.bat file to .exe
    2. Right click on the *.exe and choose "Pin to taskbar"
    3. Rename the batch file back to .cmd/.bat
    4. Shift + Right click on the taskbar icon (for the exe) and choose "Properties"
    5. Change the reference from *.exe to .cmd/.bat and change the icon as needed

    Source: 3th answer in How to pin either a Shortcut or a Batch file to the new Windows 7, 8 and 10 Taskbar and start menu? - Super User
    In this answer it is noted that
    "It starts working right away but the icon refresh needs a reboot."
    And another comment says:
    "You don't actually need to reboot, you can just kill off explorer.exe and re-run it from task manager for the icon to refresh."
      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 01:28.
Find Us




Windows 10 Forums