28

I use some programs with command line arguments and like to have shortcuts for launching those programs with those arguments. For example, I keep several Firefox profiles around and like to specify the profile name on the command line. Similarly I have several Eclipse shortcuts with a command line argument specifying the workspace to open.

I would like to be able to pin these shortcuts to the start menu or taskbar in Windows 7. The problem I have is that once I've pinned one of these, no other shortcuts which launch the same exe can be launched.

I'm also open to suggestions such as a suitable desktop gadget which can contain a bunch of arbitrary shortcuts, yet remain in a fixed position on my desktop somewhere, or some way of adding a secondary taskbar (this was possible in XP).

3
  • This is a great question for the Windows development team. I'm sure that out of the box, there is probably no way to do this, but I think this should go on the "must-have-feature-list" for future versions of windows. Mar 9, 2011 at 16:02
  • Another variation of this question is using an administration shortcut. For example, I want to keep shortcuts pinned for a normal command-prompt and an administrative command-prompt. However only one can be pinned.
    – Synetech
    Mar 9, 2011 at 19:02
  • Unfortunately this question is now protected, so I will just comment here that I don't have this problem because I use the Classic Start Menu, which I highly recommend. The top 5 pinned items on my Start Menu are all different links to cmd.exe, which I simply dragged on there.
    – David Noha
    Oct 13, 2015 at 18:51

10 Answers 10

16

I've encountered this problem recently and came up with the following solution (I'll assume a default Firefox installation when providing the example):

SETUP

Firefox executable (C:\Program Files\Mozilla Firefox\firefox.exe)

Some profiles:

  • Personal
  • Work
  • Development

SOLUTION

We'll use the MKLINK utility which ships with the OS.

Since you can only pin an application once to the taskbar, we have to make Windows believe you have several Firefox executables. We'll do this by creating a few 'hard links' to firefox.exe.

  1. Open a Command Prompt (cmd.exe)
  2. Navigate to the Firefox install directory cd "C:\Program Files\Mozilla Firefox\"
  3. Create 3 hard links for the three profiles:
    • Personal: mklink /H firefox_Personal.exe firefox.exe
    • Work: mklink /H firefox_Work.exe firefox.exe
    • Development: mklink /H firefox_Development.exe firefox.exe
  4. Create the shortcuts for the copies we've just made (Right Click > Create shortcut)
  5. Edit the shortcuts (Target field):
    • firefox_Personal.exe.lnk: "C:\Program Files\Mozilla Firefox\firefox_Personal.exe" -P "Personal" -no-remote
    • firefox_Work.exe.lnk: "C:\Program Files\Mozilla Firefox\firefox_Work.exe" -P "Work" -no-remote
    • firefox_Development.exe.lnk: "C:\Program Files\Mozilla Firefox\firefox_Development.exe" -P "Development" -no-remote
  6. Drag the 3 shortcuts to the taskbar (pin them). You can delete the original shortcuts.
  7. Change the name and icon of the pinned shortcuts, and you're good to go.

If something is not clear please let me know, and I'll try to make a screencast.

Firefox command line options from Mozilla

Firefox command line options from Mozillazine

6
  • That definitely sounded promising. Didn't work for Chrome, though. As soon as I launched the second shortcut it got grouped again with the first one... :( Aug 11, 2011 at 22:40
  • WTF! It doesn't even work when I create an actual copy of chrome.exe ... Aug 11, 2011 at 22:45
  • This works great for the Windows 7 Start Menu shortcuts, but if you pin them to the Taskbar, they'll get merged. Thanks. Jul 10, 2012 at 19:57
  • 5
    Symlinking alone didn't do the trick for me, as firefox seems to use a registry setting to store its AppID dependent on the executable's directory. The corresponding setting can be found wihtin the windows registry, located under: HKCU\Software\Mozilla\Firefox\TaskbarIDs Add a new string value for your symlinked path there and give it a value different from the default one (which otherwise seems to get used on the second run). That did the trick for me.
    – user291387
    Jan 19, 2014 at 13:37
  • There are some details in this answer regarding how programmers can override the default grouping behavior of the Windows 7 Taskbar, which can be used to break certain windows away from a Taskbar group, or to force a set of windows to combine into one Taskbar group. This could explain why Firefox and Chrome are combining to one Taskbar group, regardless of the hard-linked executable name. Feb 26, 2014 at 18:27
8

I used the solution provided by "hegearon" with MKLINK but using a folder link instead of file link.

For Firefox, I made a new folder named "Mozilla Firefox Dev" that is a link to the real Firefox folder by using this command :

mklink /D "Mozilla Firefox Dev" "Mozilla Firefox"

Then creating a shortcut to firefox.exe (make sure "start in" properties is pointing the new link directory) and pin it to the task bar.

The solution with the linked file doesn't work for me because windows knows that it is the same process (i discovered it via task manager/process explorer).

With this solution Windows believe that there are 2 distinct Firefox processes because their path are not the same.

Hope it helps.

6

In case anyone stumbles upon this, it's actually really simple to setup Firefox profiles to group into separate taskbar pins like the Chrome profile manager works.

I like to have a separate "personal" and "work" Firefox profile with separate shortcuts pinned side by side:

• Launch Firefox and go to about:config.

• Add New > Boolean > "taskbar.grouping.useprofile" > true.

• Next, close and relaunch a new instance of Firefox using RUN > "firefox.exe -P [profile] -no-remote"

• Pin this app icon to the taskbar.

• Now, navigate to C:\Users[profile]\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar.

• Edit properties on the now pinned shortcut to include the same "-P [profile] -no-remote" in the target.

Repeat this procedure for every profile you would like to pin separately to your taskbar and each profile will have its own grouping accordingly.

2
  • While this is relevant information (I praised it, in your other post), this specific question is broader. I feel you should leave a comment (directly in the question) and link to your other answer, instead of duplicating it here.
    – Marc.2377
    Jun 30, 2016 at 20:50
  • One can also get to the properties of a pinned taskbar button (those of the corresponding shortcut) by right clicking it, then right clicking the app in the popup menu to appear, then selecting Properties.
    – ᄂ ᄀ
    Oct 25, 2018 at 9:18
5

You can't pin batch files and shortcuts to Windows 7's task bar directly. Here's an easy workaround that may suffice:

  1. Make a folder someplace.
  2. Create batch files to launch your programs with the specific command-line arguments you want for each, and stick them in that folder.
  3. Right-click a blank area on the Windows task bar --> Toolbars --> New Toolbar
  4. When the "choose a folder" dialog opens, locate and select the folder you created.
  5. Use the task bar options (Unlock, Show Title, Show Text, etc.) to adjust the icon(s) appearance to your liking.

You're not going to get all the nice Windows 7 stuff like previews and such, but I'm not sure you care about that. ;)

EDIT: Rocketdock is a tool that may fit your bill: https://punklabs.com/

Hope that helps...

4
  • This is a good suggestion but unfortunately for me it clutters the taskbar too much (I miss XP's multiple-taskbar feature). Mar 9, 2011 at 18:37
  • I'm not really sure how that clutters the bar any more than a bunch of pinned icons, but hey. ;) Yes, it's annoying you can't undock them; added a gadget link for you, hope it helps... Mar 9, 2011 at 18:46
  • It clutters the bar mainly because in XP I actually had two task bars, one at the top of the screen and one on the far right edge, and the right-hand one had all my shortcuts. In 7 you can only have one taskbar. Mar 10, 2011 at 2:11
  • 1
    This is a good answer, but cant you just put shortcuts in that folder instead of batch files?
    – Zombo
    Dec 31, 2014 at 0:33
4

Don't pin the EXE nor the "official" shortcut: make a shortcut for each profile and then pin them.

1.- Create your own shorcuts in your documents or in your desktop, one for each profile. I did it in "Dropbox\Profiles":

"File" -> "New" -> "Shortcut" -> type the full path

C:\Users\t130688\AppData\Local\MapleStudio\ChromePlus\Application\chrome.exe --user-data-dir="D:\Navegadores\t130688"

Enter and type a distintive name, p.e. "Cool t130688"

2.- Right clic in each shortcut and in "Pin to taskbar"

1
  • 1
    This appears to work generically (I don't have Chrome installed, but tested with Defrag.exe). But it doesn't work for Firefox without a tweak (suggested in MathewCNichols' answer ).
    – Marc.2377
    Jun 30, 2016 at 19:56
3

Let us assume we need to pin 2 shortcuts to the Start Menu (doesn't work with Taskbar!):

  • "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -p User1
  • "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -no-remote -p User2

The easiest way is:

  1. Pin some unrelated application (say, C:\Program Files (x86)\Mozilla Firefox\crashreporter.exe because it's nearby).
  2. Pin the application needed, i.e. C:\Program Files (x86)\Mozilla Firefox\firefox.exe. Now you can edit this shortcut adding necessary arguments.
  3. Edit the first pin replacing crashreporter with firefox and adding arguments needed.
  4. You can also wish to rename shortcuts like Firefox (User1) and Firefox (User2).

This method doesn't work with the Taskbar, as I mentioned before. In this case, use one of the workarounds suggested by other users.

2

Say you want a second copy of chrome on your taskbar (select folder properties to show extensions of files)

  • Create an empty file somewhere and call it "chrome1.exe"
  • Drag & pin it to taskbar
  • Rename the file to "chrome1.bat"
  • Shift+Right-click the taskbar icon & select properties
  • Change the target to ".bat" from ".exe" (since you renamed your file)
  • Edit chrome1.bat & add start <path to chrome app>\chrome.exe
  • Change the icon if needed
0

After searching for hours, and trying everything, I figured out how to get two profiles running off different icons in the taskbar (ie. different icons and so that they don't combine).

This is all in Win7, and make sure you are careful to use the quote marks I've used in the 'type this' lines. They make a difference. Type everything in bold exactly as is.

Firstly, create a new firefox profile. Go to Start Menu Run and type: Firefox.exe -profilemanager

Create new profile called Mail for use with mail clients etc (or whatever you want to use it for).

Open cmd prompt as Administrator (In Run type cmd then right click CMD and open as admin)

Type this then hit enter:
mklink /H "C:\Program Files (x86)\Mozilla Firefox\fmail.exe" "C:\Program Files (x86)\Mozilla Firefox\Firefox.exe"

Type this then hit enter:
mklink /D "C:\ProgramData\Mozilla Firefox" "C:\Program Files (x86)\Mozilla Firefox"

Create a new link by right clicking anywhere on desktop and choose New->Shortcut

Type in Target: "C:\ProgramData\Mozilla Firefox\fmail.exe" -p Mail -no-remote

Type in Start In: "C:\ProgramData\Mozilla Firefox"

Now click Apply then Ok.

Right click it, then Properties.

Change Icon to Standard Windows Mail icon (just select any random file, and if it doesnt find one, the default ones will come up. The Mail icon is on the top about halfway along)

Click Ok - Apply - Ok

Move this shortcut to the taskbar by dragging it onto it.

You should now have a mail icon in the taskbar.

Right click it, then right click fmail.exe then Properties

Change icon to the same Mail icon you just used previously.

Click ok - apply - ok.

Go to Start Menu Run and type: %localappdata%

Delete IconCache.db in the folder that pops up

Go back to black and white cmd window

Type & hit enter: taskkill /f /im explorer.exe

Type & hit enter: explorer.exe

Now right click the firefox icon in the taskbar and right click firefox.exe then properties

Type in Target: "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -P default -no-remote

Click OK

Now you can open two profiles simultaneously, with different icons on the taskbar!!

Open the Mail icon, then CHANGE THE APPEARANCE/THEME under add-ons so you instantly recognise which one you're in by choosing a very different theme to your main browsing profile.

Don't forget to add the usual minimum add-ons (BetterPrivacy, Redirect Remover, Adblock Edge, Self-Destructing Cookies) to the new profile as it is a completely blank profile.

PS> If you are still having issues with icons combining on the taskbar, Run -> regedit, and find "HKEY_CURRENT_USER\Software\Mozilla\Firefox\TaskBarIDs" Then create a new string key called "C:\ProgramData\Mozilla Firefox" and use the same data variable as in the standard one that's there, but change the very last character to anything else. This will stop the icons on the taskbar combining.

PPS> If you're still having issues, make sure you type in EXACTLY what I did above in bold INCLUDING THE QUOTE MARKS!!!!

1
  • 1
    Never use -no-remote to start the "default" profile (the one that is set to open without asking when you launch Firefox). That's because when you launch Firefox, for example, by clicking a link in your mail program, you will get a Firefox is already running but is not responding message if the default profile is already in use. The solution is to always start the default profile normally and launch all others with -no-remote. Then it will work. (source)
    – Marc.2377
    Jun 30, 2016 at 20:44
0

I needed this for my git-bash.exe shortcuts.

I have a few directories that I work with, and wanted to be able to click on a separate icon in the taskbar to open each git-bash.exe for each path.

The simple solution, is to create a copy of git-bash.exe, and call it git-bash2.exe

I then point my first shortcut to the original exe, and the second shortcut to the copy, then I can change the icon on each shortcut, and pin them both independently to the task bar.

Incidentally, you just have to be aware that if you update git-bash.exe, you'll have to re-copy the exe.

-1

You can simply copy the Eclipse application at the same location, and then pin that new copy of Eclipse to the Start menu. You can make that point to a different workspace.

You can repeat this as often as required.

1
  • 2
    Are you referring to making a copy of the .exe with a different filename? Some apps require specific executable filenames for security reasons so this may not work for all applications.
    – Mufasa
    Nov 8, 2012 at 20:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .