341

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)

Shaharyar
  • 3,761

7 Answers7

467
  1. Create a shortcut to your batch file.
  2. Get into shortcut property and change target to something like: cmd.exe /C "path-to-your-batch".
  3. Simply drag your new shortcut to the taskbar. It should now be pinnable.
Kamil Klimek
  • 4,839
  • 1
  • 18
  • 13
65

This thread nearly answers my problem, another thread worth reading that solves these issues in a different way is here:Adding Batch Files to Windows 7 Taskbar like the Vista/XP Quick Launch

I was able to add a batchfile to the taskbar by the following steps:

  1. Renaming your .cmd/.bat to to .exe
  2. Right clicking on the *.exe and choose pin to taskbar
  3. Renaming it back to .cmd/.bat
  4. Shift+right clicking the taskbar icon (for the exe) and choose properties
  5. Changing the reference from *.exe to .cmd/.bat and change icon as needed

It starts working right away but the icon refresh needs a reboot.

I have an additional question though: how do you get a pinned taskbar batch file accepting another file as a parameter? It works when pinned onto the startbar, or just in the folder, but I can't get it working like it did on XP.

This is the functionality I'm talking about:

Drag and drop a file on the bat icon. The bat will receive the file name of the dropped file as %1 and vbscript will receive it as WScript.Arguments(0).

mic84
  • 2,413
daniel
  • 819
19

The folder for the Windows 7 taskbar is located at:

C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar

The Start Menu folder is:

C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu

You can create a shortcut there and upon logging off and back on, it should appear.

Hope this helps.... There are other things I should caution you about, for example, they can right click and edit the batch file - so, you may want to look at NTFS permissions for locking down the file.

Dan Pritts
  • 1,069
William Hilsum
  • 117,648
5

I will add another useful method.. In Windows 10, do you want to have simpler Taskbar, where you can pin things easily (small icons) like this?:

enter image description here

so you will see only those programs that are opened.

In "Documents", create a folder, named "my icons", and put there desired shortcuts. Then right click on taskbar -->"New toolbar":

enter image description here

and select your folder. Then unlock taskbar, right click on the new toolbar, and uncheck "Show Title" and "Show Text":

enter image description here

p.s. dont forget to uncheck "NEVER COMBINE ICONS" in taskbar properties:

enter image description here

T.Todua
  • 4,053
3

In my case, none of these solutions got it to 100%. They were close, but on the latest windows 10 these are the steps that I had to follow:

1. Rename .bat to .exe
2. Right click .exe => Pin To Start
3. Right click .exe => Rename to .bat
4. Right click taskbar/start menu item => More => Open File Location
5. Right click the shortcut => Change target from .exe to .bat

Done!

iuliu.net
  • 151
3

Yes this is an annoying "feature" of the windows 7 taskbar. I built a simple application that runs batch files which you can pin to your taskbar and pin batch files to it. It gets the job done. Download it for free -> http://johnastevens.com/helpTopics.aspx#batchapp

studiohack
  • 13,477
2

This only works for 1 .bat at a time, but if that's all you need:

  1. Search for "Command Prompt" in start menu
  2. Right-click, "Pin to Taskbar"
  3. Right-click the pinned icon in taskbar and go to Properties
  4. Change "Target" to the path to your .bat
  5. Change "Start in" to your desired working directory

Clicking it should now run your .bat.

Dan
  • 890