Google Chrome fails to open HTML links or files

google-chromehtml

There are two persons using my computer, so I made two shortcuts to the application, each one having its own argument "–user-data-dir=""" so that each of users has unique settings.

All was working well, but I was annoyed because the links from external applications (FeedReader, Visual Studio help, Microsoft Word document links) or local HTML files were opened in default Google Chrome installation, therefore not using my folder of preference (which is one of the two above mentioned).

So, I went on to changing the following registry setting:

Computer\HKLM\SOFTWARE\Classes\ChromeHTML\shell\open\command = ""C:\Users\Witchunter\AppData\Local\Google\Chrome\Application\chrome.exe" –user-data-dir="c:\Users\Witchunter\AppData\Local\ChromeUserData\shortcut-1311099461053""

The browser acted weird when I changed this settings, opening but not displaying HTML file, instead showing "New Tab". Each consecutive opening of the file opened another instance of the browser, again with only "New Tab" opened, as if I run it from desktop shortcut.

I tried reverting setting to:

Computer\HKLM\SOFTWARE\Classes\ChromeHTML\shell\open\command = ""C:\Users\Witchunter\AppData\Local\Google\Chrome\Application\chrome.exe"

to no avail. The browser acts as described, the only thing it is not using my settings, but default ones. The operating system is Windows 7 x64.

Had anybody else have this issue? How can I resolve the problem?

I found this question on SuperUser, but it is somewhat old, relevant to Mac and not answered.

Best Answer

Well, it appears nobody encountered this situation before. Since someone could have the same issue some time in the future, I decided not to delete my own question, but to answer it.

I fixed the issue by adding -- "%1" switch, so the registry entry looks like this:

[Computer\HKLM\SOFTWARE\Classes\ChromeHTML\shell\open\command] "C:\Users\Witchunter\AppData\Local\Google\Chrome\Application\chrome.exe" --user-data-dir="c:\Users\Witchunter\AppData\Local\ChromeUserData\shortcut-1311099461053" -- "%1"

It is very important that "%1" switch is the last one and that there is a space character between -- and "%1". I am not sure why is this particular switch used this way, but it is crucial to have a space character in between. If this character is not present, new Chrome window will open up displaying "New Tab".

Hope someone finds this useful.

Related Question