1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

Resolved Cerating a Shortcut on Task Bar for a Bat File

Discussion in 'Windows 10' started by gw1500se, 2023/08/18.

  1. 2023/08/18
    gw1500se

    gw1500se Well-Known Member Thread Starter

    Joined:
    2003/01/10
    Messages:
    444
    Likes Received:
    0
    I have the following bat file that executes a python script:

    @echo off
    cmd /c "cd /d C:\cygwin64\home\Dennis_Putnam & cd /d C:\cygwin64\home\xxxxxxxxxx & py -3 .\windonotcall.pyw"

    I have been able to create a short cut on the desktop (which works) at which time the contextual menu contains "pin to task bar." That seems to be the only way to get that menu option. However, when I try to run that command from the task bar, I get a cmd window with a prompt. The rest of the commands do not execute. What am I doing wrong? TIA.
     
  2. 2023/08/22
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400

  3. to hide this advert.

  4. 2023/08/22
    gw1500se

    gw1500se Well-Known Member Thread Starter

    Joined:
    2003/01/10
    Messages:
    444
    Likes Received:
    0
    Thanks but that does not address the problem. I have a working script but the problem is it does not work when the shortcut is pinned to the task bar.
     
  5. 2023/08/22
    Steve R Jones

    Steve R Jones SuperGeek Staff

    Joined:
    2001/12/30
    Messages:
    12,314
    Likes Received:
    252
    Have you ever created a NEW Toolbar on the taskbar? Then you could add the shortcut...

    It'd be a total of two clicks..

    Speaking of clicks, how many times a day do you need to run your script?
     
  6. 2023/08/22
    gw1500se

    gw1500se Well-Known Member Thread Starter

    Joined:
    2003/01/10
    Messages:
    444
    Likes Received:
    0
    Thanks. Yes but that just adds a folder. I suppose that is better than nothing. As for how often, it varies between 0-10.
     
  7. 2023/08/23
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    Try this;
    Search for "Command Prompt" in start menu
    Right-click, "Pin to Taskbar"
    Right-click the pinned icon in taskbar and go to Properties
    Change "Target" to the path to your .bat
    Change "Start in" to your desired working directory

    or

    The reason the shortcut does not work is because its target path needs to be changed:
    change the target path back to path-to-your-bat
    C:\Users\<User name>\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar
     
  8. 2023/08/23
    gw1500se

    gw1500se Well-Known Member Thread Starter

    Joined:
    2003/01/10
    Messages:
    444
    Likes Received:
    0
    Thanks for the reply but unfortunately there is no "properties" option when I right click. All I get is "command prompt" and "unpin from taskbar." This has been the problem all along. I don't get the right options in the contextual menu when I expect them.
     
  9. 2023/08/24
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    I'll bet Properties does exist, you'll need to right ckick 2 times.
    Rt click the taskbar icon and you should see 2 selections:
    Command Prompt (or name of shortcut)
    Unpin from taskbar
    Right click the 1st selection to get to Properties.
     
  10. 2023/08/24
    gw1500se

    gw1500se Well-Known Member Thread Starter

    Joined:
    2003/01/10
    Messages:
    444
    Likes Received:
    0
    Cool. I was not aware of that. Thanks. It is working now.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.