32

I am making an application and I want to make it installable on the user's desktops using chrome URL shortcut. Therefore, is there a universal path to the chrome.exe that can launch my app on all Windows versions ( XP, Seven and vista )

Ripon Al Wasim
  • 36,924
  • 42
  • 155
  • 176
Sirine Hlima
  • 327
  • 1
  • 4
  • 7
  • See https://stackoverflow.com/questions/45384893/how-do-i-use-c-sharp-to-get-the-path-to-chrome-exe-on-windows/45384927#45384927 – zumalifeguard Aug 31 '17 at 23:07

6 Answers6

39

Chrome installs by default to the User's AppData Local folder:

XP:

C:\Documents and Settings\UserName\Local Settings\Application Data\Google\Chrome

Vista:

C:\Users\UserName\AppDataLocal\Google\Chrome

Windows 7:

C:\Program Files (x86)\Google\Application

Win 7/8/10/11, (either):

- C:\Program Files (x86)\Google\Chrome\Application
- C:\Program Files\Google\Chrome\Application

Best bet is to use some OS detection code, then use an environment variable to detect the User's AppData folder (i.e. %LOCALAPPDATA%) or the ProgramFiles folder, and then append the difference in OS's to the end of the variable.

J. Scott Elblein
  • 4,013
  • 15
  • 58
  • 94
  • 1
    MIght i recommend that if you need to support the older systems, `C:\Users\%UserName%\AppDataLocal\Google\Chrome` is the percent signs around the username. Then it will pass in who is logged into that box. – Daniel L. VanDenBosch Sep 22 '17 at 11:55
  • 1
    Google has changed that. Now Chrome installs into the Programs folder as it should have done from the first day. – Elmue Oct 31 '19 at 16:36
  • How can I know in which directory chrome was installed in (`Program Files (x86)\...` or `Program Files\...`)? – Mahmoud Mousa Hamad Jul 12 '22 at 03:34
  • @MahmoudMousaHamadAs of today's date (since Google likes to play whack-a-mole with us), what I would probably do is first fetch the `ProgramFiles` Environment Variable, and append `\Google\Chrome\Application\chrome.exe` to it, test that the file exists, and if not, do the same with the `ProgramFiles(x86)` environment variable. If it's installed, it should find it at one of the 2 places. – J. Scott Elblein Jul 12 '22 at 05:04
37

You can look in the Registry:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe
msc
  • 33,420
  • 29
  • 119
  • 214
Clay Nichols
  • 11,848
  • 30
  • 109
  • 170
  • 3
    I didn't have an entry here. But I did search the registry for "chrome.exe" and it came right up. Mine is in Program Files(x86)\Google\Chrome\Application\chrome.exe for Windows 10. – fIwJlxSzApHEZIl Mar 10 '16 at 16:01
5

The registry option might be the best, but the one suggested in the other answer didn't exist in my computer (Windows 10 64-bit). I think the "Uninstall" key might be more robust. If it didn't exist, users would have a hard time uninstalling Chrome. The following keys give you the install location, you'll need to append "\chrome.exe" to get the full path to the executable:

Chrome:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\Google Chrome\InstallLocation
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Google Chrome\InstallLocation

Chrome Canary:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\Google Chrome SxS\InstallLocation

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Google Chrome SxS\InstallLocation
J. Scott Elblein
  • 4,013
  • 15
  • 58
  • 94
JLCastillo
  • 71
  • 1
  • 4
  • 3
    I have Chrome installed on my computer, but I don't see it listed at this location. Running Windows 10 64-bit – zumalifeguard Jun 17 '17 at 01:22
  • @zumalifeguard I edited the answer, try with HKEY_LOCAL_MACHINE. If you don't find it there, open Regedit and try to look for the string "chrome.exe" repeatedly pressing F3 until you find the Uninstall key. And please share with us. – JLCastillo Jun 18 '17 at 15:29
  • JL, Take a look at the logic that Karam's chrome-launcher uses to locate chrome. https://github.com/karma-runner/karma-chrome-launcher/blob/master/index.js It's fairly robust. The other place I thought would be useful is `HKEY_CLASSES_ROOT\ChromeHTML\shell\open\command` you can parse out the exe in there as well. – zumalifeguard Jun 21 '17 at 02:28
  • 1
    @zumalifeguard in my computer the path you mentioned doesn't exist, because a bunch of letters and numbers is appended to 'ChromeHTML': `HKEY_CLASSES_ROOT\ChromeHTML.\shell\open\command`. Does HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Google Chrome\InstallLocation exist in your computer? – JLCastillo Jun 21 '17 at 16:54
4

Win 7 32 bit:

c:\Program Files\Google\Chrome\Application\chrome.exe

Win 7 64 bit (or W10 64b):

c:\Program Files (x86)\Google\Chrome\Application\chrome.exe

(which is different from the preceding answers and comments).

Clay Nichols suggestion to look in the registry is of course recommended.

Please do not edit!

Someone "edited" this answer saying 32 bit paths are always (x86), showing a total misunderstanding of the question and the answer! The path c:\Program Files (x86)\ does not even exist on a 32 bit machine (unless you manually add it youself); both of the above are tested answers.

J. Scott Elblein
  • 4,013
  • 15
  • 58
  • 94
www-0av-Com
  • 707
  • 10
  • 14
  • 2022 Win 10 64bit `C:\Program Files\Google\Chrome\Application\chrome.exe` – TwoFingerRightClick Apr 22 '22 at 05:42
  • @TwoFingerRightClick - not on my 2022 Win 10 64bit. Have you tried it? Anyway, Chrome is still 32 bit unless you have a Beta of a 64b version. – www-0av-Com Apr 24 '22 at 10:38
  • Hmm. Chrome has been built 64 bit for a good while now (since chrome 37 according to this article : https://arstechnica.com/information-technology/2014/08/chrome-64-bit-browser-finally-available-as-a-stable-version/). So new installs will be installed in `C:\Program Files\Google\Chrome\Application` One can check if version is 64 bit as in about chrome it will have a `(64 bit)` at the end of the version. Maybe you are thinking of Chrome Android which is more recently released in 64 bit. – TwoFingerRightClick Apr 25 '22 at 17:02
  • Perhaps people have been using Chrome so long, that they never did a new install of it and so still have the 32 bit version? Or maybe Chrome just keeps using the same directory that it was originally installed in back in the day when it was 32-bit? – TwoFingerRightClick Apr 26 '22 at 01:59
  • I found an article that answers those questions, and it was that google just kept using the x86 folder untill 2020 even though chrome is 64 bit since 2014 : https://techdows.com/2020/06/64-bit-chrome-install-program-files-windows.html – TwoFingerRightClick Apr 26 '22 at 02:06
1

For Windows users chrome.exe could have been be installed in several places based on the user's Window's edition (64 or 32-bit) and when the user installed Chrome it:

Current Locations

It'll most likely be in either:

*Much confusion is caused by the fact that Chrome has been 64 bit since 2014, but Google still used Program Files (x86) until 2020 as the install location. And if you installed Chrome before 2020 then it will continue to live in the Program Files (x86) directory:

Browsers installed under "C:\Program Files (x86)" remain in that
directory and will continue to be updated. They must be uninstalled
first to be reinstalled under "C:\Program Files".

Legacy Locations

Chrome used to install to the user folder for Vista and XP:

XP:
C:\Documents and Settings\UserName\Local Settings\Application Data\Google\Chrome

Vista:
C:\Users\UserName\AppDataLocal\Google\Chrome
-1

I had a .mht file that I would like to open in chrome, and found that just running:

chrome.exe "path-to-file.mht"

would work just fine! No need to find the path :)

J. Scott Elblein
  • 4,013
  • 15
  • 58
  • 94
Ove Halseth
  • 431
  • 5
  • 13
  • 3
    It is not certain that the path to _chrome.exe_ will be saved in system _PATH_ variable :( – Skorek Sep 02 '19 at 10:45