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).

10 Answers10

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

hegearon
  • 442
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.

wonea
  • 1,877
xfr
  • 81
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.

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

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"

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
user
  • 1,217
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.

Rich S
  • 353
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

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.

slhck
  • 235,242