Chrome – How to start Chrome using a specified “user profile”

command linecommand-line-argumentsgoogle-chromeuser-accountsuser-profiles

I use the new built-in "Users" feature of Chrome to switch between Home/Work accounts easily. However, Chrome remembers the "last" user profile you had selected when launching new windows. This is a problem if I close down my "Home" profile last, because when I then click the Email shortcut on my taskbar, because it goes to mail.mycompany.com using my Home profile, and I'm not logged in.

I'd like to change the shortcut to the company webmail to pass a switch that tells Chrome to always start as the "Default" user, regardless of the last one used.

Note: I have tried the command-line parameter --user-data-dir=…, and this seems to do something very different, completely isolated from the Users functionality built in to Chrome. It's possible I'm using it wrong, but please test this before assuming it does the same thing and posting an answer 😉

Best Answer

The command line argument you're looking for is --profile-directory=Default.

Here's the complete command line for Mac OS X:

open -a "Google Chrome" --args --profile-directory=Default

Note: The open command therefore does not launch new instances, as many applications will not be able to deal with multiple instances running as the same user. However there's the -n argument to do that anyway, but it may break the application.

And for Linux:

google-chrome --profile-directory=Default

It expects the internal names of the profiles: My second profile, named "Lemonade" by Chrome, would be --profile-directory="Profile 1".

Determine the profile name by trial and error, or looking in the Local State file (see Justin Buser's answer).

On Mac OS X, the directories are located in ~/Library/Application Support/Google/Chrome. In Linux they are located in ~/.config/google-chrome. In Win7 they are located in %USERPROFILE%\AppData\Local\Google\Chrome\User Data.

Related Question