5

I moved the chrome 'user data' directory and successfully launched the profile from here using the commandline switch --user-data-dir="E:\chrome", however, if i click a link it will open up a new instance of chrome, recreating a blank chrome profile and a new user data folder.

How can I fix that?

2
  • 1
    It looks like the latest version (12) of Chrome has beta ability to run multiple profiles. You have to manually enable it in the flags page (chrome://flags, at the bottom). I don’t know if it will help when registering it as the default browser though, and they seem resistant to bother trying to fix the issue (apparently anything that isn’t trivial gets permanently untriaged and back-burnered or worse, audaciously marked “WontFix” as though they intend it to be that way).
    – Synetech
    Jun 11, 2011 at 2:41
  • 1
    possible duplicate of Make Google chrome with specific user profile as default browser
    – Synetech
    Jul 19, 2012 at 19:28

3 Answers 3

0

Create a symlink pointing the default location to the one you chose.

mklink /d "%LocalAppData%\Google\Chrome\User Data" E:\chrome
6
  • That’s not bad if the system drive is NTFS and the only command-line argument is user-data-dir.
    – Synetech
    Mar 15, 2011 at 5:44
  • 1
    Who uses FAT32 for the system drive, anyway? Mar 15, 2011 at 5:45
  • 4
    Everybody who uses FAT32 for the system drive.
    – Synetech
    Mar 15, 2011 at 5:46
  • 1
    Would that be the same people who use IE6 as main browser and floppy disks as backup media? (Because believe me, I've had my share of FAT32 disk corruptions caused by simple things such as unplanned reboots or flaky USB cables.) Mar 15, 2011 at 5:47
  • 2
    No idea; but maybe a good portion of the people who still use XP? I just know that I like booting into DOS mode and using Norton DiskEdit to dig into the drive to do whatever needs to be done whenever necessary. I have yet to find a similar way in Windows or with NTFS.
    – Synetech
    Mar 15, 2011 at 6:12
3

Add a string value called "UserDataDir" under "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome" with the value of the user-data-dir that you'd like to use. Then you can start chrome.exe without arguments and launching *.html files from the file browser will open using this user-data-dir as well.

1
  • Awesome, it does actually work great (at least with Google Chrome v24). I had to create "Google" and "Chrome" keys first though since they are missing by default. And I wonder what's the list of all the options we could put there... Nov 10, 2012 at 21:37
1

I’ve been struggling with this issue since switching to Chrome when it first came out. Unfortunately Chrome is not designed (or currently intelligent enough) to include command-line arguments when it registers as the default browser.

I have submitted an issue to request that Chrome / Chromium include command-line arguments when registering as the default browser, but don’t hold your breath on it being implemented. (They are apparently not interested in fixing this.)

Tl;dr: skip next paragraph.


My first solution—read work-around—was originally to create a .REG file to manually set the command-line for each of the various places that need to be registered (for HTM* files, for HTTP* protocols, for hyperlinks, etc.) Of course that became quite untenable, especially since I used expandable strings (which are exported to REG files as unreadable / un-editable binary text) so that I could use environment variables. I don’t recommend this method.


My next (and current) solution was to create three environment variables, browser, browser_args, and browser_args_cu. The former variable simply holds the path to the browser’s EXE file. The second holds the command-line arguments for the browser (if any), while the last one holds user-specific arguments (such as the userdata folder location). Then, I simply replaced all instances where a browser needs to be registered (see list below) with the expandable string %browser% %browser_args_cu% %browser_args% -- "%1" and created a (4KB) REG file.

Now, I can register my “browser” of choice by merging my REG file just once. If I want to change my browser, I need not edit the REG file; all I have to do is change one or two environment variables (eg in System Properties), which is infinitely easier. Plus, I can run the browser with the appropriate command line anywhere, anytime by running the short command %browser% %browser_args_cu% %browser_args% -- "%1" and can even test other options by tacking them on to the end, or better, just put the variables in a batch file or shortcut (eg named browser). Then for example, to install an extension without experiencing the crippling bug that I have been trying to help fix, I can just close Chromium, then run browser --single-process or I can open the extension’s page directly like browser --single-process https://chrome.google.com/webstore/detail/….


List of places in the registry where Chrome/Chromium is set:

[HKLM\SOFTWARE\Clients\StartMenuInternet\Chromium\shell\open\command]
[HKLM\SOFTWARE\Clients\StartMenuInternet\Google Chrome\shell\open\command]

[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe]
[HKCR\Applications\chrome.exe\shell\open\command]

[HKCR\ChromeExt\shell\open\command]
[HKCR\ChromeHTML\shell\open\command]
[HKCR\ChromiumExt\shell\open\command]
[HKCR\ChromiumHTML\shell\open\command]

[HKCR\ftp\shell\open\command]
[HKCR\http\shell\open\command]
[HKCR\https\shell\open\command]

[HKCR\MacromediaFlashPaper.MacromediaFlashPaper\shell\open\command]

[HKCR\pdf_auto_file\shell\open\command] (these two are custom for opening
[HKCR\svg_auto_file\shell\open\command]  PDF and SVG files with)
2
  • Are we to assume these instructions are for Windows 7?
    – Moab
    Aug 22, 2011 at 15:48
  • It doesn’t matter, they are not Windows-version-specific; XP and 7 both have the entries (at leas the first 11, the others are custom and/or dependent on other software). The first 11 are modified by Chrome when you click the “Make default browser” button (technically, you may or may not get both the Chrome and Chromium keys depending on which version of which browser you use, but there’s no reason not to use both).
    – Synetech
    Aug 23, 2011 at 0:41

You must log in to answer this question.

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