Link to home
Start Free TrialLog in
Avatar of jana
janaFlag for United States of America

asked on

Place shortcut from batch file to Windows 10 taskbar

Hi Expert!


I think I have placed this question before, but I cannot find it (sorry).  I am trying to place a shortcut to a batch file to the task bar (no success so far).  The batch file apps contains the following instruction (just in case needed):


@echo off
if exist Q:\FOLDERNAME (
    start "" "c:\path\path\path\APPS-NAME.EXE"
) else (
    echo !! You Must Have Q: Available !!
    pause
)

Open in new window


The properties of said batch file is as follows:

User generated image


This shortcut works perfect from desktop and anywhere else, but how can I place it in the task bar?

Avatar of ☠ MASQ ☠
☠ MASQ ☠

This shortcut works perfect from desktop and anywhere else, but how can I place it in the task bar?  


%USERPROFILE%\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar

Open in new window


is that the path you are looking for?


Avatar of jana

ASKER

Hi MASQ, thanx u for locating it! (I thought it was for taskbar but that question was for "verify existence of X drive")


Hi, Seth Simmons, will try

Avatar of jana

ASKER

Hi Seth Simmons, didn't work.  I copied the shortcut there and my Taskbar didn't show it

ASKER CERTIFIED SOLUTION
Avatar of ☠ MASQ ☠
☠ MASQ ☠

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jana

ASKER

No MASQ, will try

Avatar of jana

ASKER

MASQ , No option "Pin to Taskbar" 

User generated image


Apologies you need to edit the path in the shortcut properties, here I've added /k to keep the batch file window open.  Otherwise use /c (and wrap the target path and file name in quotes.) Then you can Pin.


User generated image


Hi Seth Simmons, didn't work.  I copied the shortcut there and my Taskbar didn't show it

Did you reboot, or kill and restart Explorer process, I think that is required…

~bp
Avatar of jana

ASKER

Hi Bill Prew, I did restart the computer.


User generated image

MASQ, I added the " /k" and could see "Pin to Start" and also "Unpin to Start", so that worked.  Unfortunately, pinning did not place the shortcut to the taskbar (by Taskbar I mean the bar as pix below)

User generated image


SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jana

ASKER

I don't see it

Avatar of jana

ASKER

Can u give an example of yours?

Add a pause command to the batch file (line 8) - start the batch file. The running (cmd) application should now be shown on the taskbar. Right click the (running) application on the taskbar and select 'Pin to taskbar'. Then remove the pause command from the batch file again.

Avatar of jana

ASKER

MASQ, that is what I have in my entry, my question there is after I pin-to-start, where does it appear? (I don;t see in the taskbar)


Hi Gerwin Jansen, I placed a pause as recommended, but what it does it display the CMD window, not the apps that it;s suppose to run.

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jana

ASKER

Thank u very much! "Pin to Taskbar" worked!


last inquiry prior closing the question, when I "Pin to Start", where can I see the icon?. 

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jana

ASKER

Thank u very much!

Avatar of jana

ASKER

(while awarding I nonticed that u have mention "pin to taskbar" (sorry didn't see it)

Avatar of jana

ASKER

Guys, I know I closed the question, but I just noticed I need some info on the subject: 


Without "cmd.exe /k" there is no "Pin to Start/Taskbar", but when I placed the CMD as recommended, the "Pin" appears - Why?

Windows won't pin a file that isn't executable (.exe) so the workaround is to get the shortcut to point at CMD which is executable (even though if you launch a batch file it opens with CMD!).  (The shortcut says "Open CMD and then use it to open this batch file)


My guess is Microsoft don't want people filling up the taskbar/Start menu with Pinned batch files but frankly who knows why this limitation is there :)

Avatar of jana

ASKER

Thank u very much!