Sirine Hlima
Sirine Hlima

Reputation: 347

Universal path to chrome.exe

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 )

Upvotes: 34

Views: 127491

Answers (7)

Saurav Bhagat
Saurav Bhagat

Reputation: 55

I was looking out for mac and this is how I found:

1. Using Finder: Open Finder. Navigate to the Applications folder. Find Google Chrome. Right-click on Google Chrome and select "Get Info." In the "General" section of the info window, you'll see "Where:" which shows the path to the application. By default, it should be /Applications/Google Chrome.app.

2. Using mdfind Command in Terminal: Open Terminal.

Run the following command:

mdfind "kMDItemDisplayName == 'Google Chrome' && kMDItemKind == 'Application'"


Using the first point I checked and verified using command mentioned in second point.

The path to the Google Chrome application is typically /Applications/Google Chrome.app if not manually installed in some other path.

Upvotes: 0

Ove Halseth
Ove Halseth

Reputation: 461

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

Upvotes: -1

TwoFingerRightClick
TwoFingerRightClick

Reputation: 832

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

Upvotes: 2

J. Scott Elblein
J. Scott Elblein

Reputation: 4253

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.

Upvotes: 39

www-0av-Com
www-0av-Com

Reputation: 735

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.

Upvotes: 4

JLCastillo
JLCastillo

Reputation: 71

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

Upvotes: 5

Clay Nichols
Clay Nichols

Reputation: 12139

You can look in the Registry:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe

Upvotes: 38

Related Questions