276
74
We are having trouble adding our batch scripts to the Windows 7, 8 or 10 taskbar or start menu.
Our batchfiles take some arguments and just execute other application based on those arguments . To keep it simple, we created some shortcuts for our customers which they just need to click in order to get everything running.
The question here is: How can we pin those shortcuts or batch files to the taskbar or start menu?
(The customers aren't supposed to access the file system and that's why they can only see the taskbar)
1Although this 'seems' to work but the behavior isn't quite the same. 'Standard' pinned program will be active (selected) once it is clicked so when you click it again later it will bring the program to the front. But with pinned shortcuts, it will start a new process/window every time you click it. So it is not quite the expected behavior. – Rosdi – 2015-03-03T04:13:18.613
1What does
/C
incmd.exe /C "path-to-your-batch"
exactly mean? – Daniel Krizian – 2015-04-07T12:36:38.013/C is command i gues - shortcut launches batch and executes command after /C in it – Kamil Klimek – 2015-04-08T13:01:13.557
1
@Daniel check http://stackoverflow.com/a/515316/146513
– Mariano Desanze – 2015-12-08T06:47:35.840Not working if you have spaces in
"path-to-your-batch"
even if it's quoted, so be aware of it – ABCplus – 2017-05-17T10:05:49.317I tried this for a .cmd file (e.g. my.cmd) and it doesn't work for me. I ensured there was no spaces in my path, but still can't pin it. Can I pin .cmd files? – sdoca – 2017-08-21T20:39:46.503
The answer from apple16 to prevent a cmd window to pop up also fixes the problem induced by the original solution : when cmd windows are opened, they share the same icon than the one of the pinned shortcut, which was even more annoying for me. – Manuel Rozier – 2017-11-24T13:22:13.043
help cmd
say:/C Carries out the command specified by string and then terminates
– Alejandro Blasco – 2018-03-12T19:38:25.180This solution works properly for me, but if you want to remain the cmd open you should use /k instead of /c – Balder – 2018-07-16T11:02:20.883
6Such a simple solution. Strange that pinning of direct shortcuts to batch files is not supported. – Steve Crane – 2011-02-07T08:16:35.727
Unfortunately if you have multiple batch files to pin, they don't stack similar to how explorer pins work. – Jeff Mercado – 2012-05-25T18:52:50.633
17And if your annoyed that a cmd window pops up every time you use the shortcut, after pinning, you can open the shortcut at
C:\Users\<User name>\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar
and change the target path back topath-to-your-batch
– apple16 – 2012-11-01T22:53:25.117Added SU to my network just to give KamilKlimek my upvote on his answer. Thanks also to @apple16. – None – 2012-12-07T22:19:05.043
11The names and icons stick after you pin the item, so it is good to also perform step 2.5: Change the name and icon of the shortcut. – JohnEye – 2013-04-05T13:49:49.393