Universal path to chrome.exe Universal path to chrome.exe google-chrome google-chrome

Universal path to chrome.exe


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

XP:C:\Documents and Settings\UserName\Local Settings\Application Data\Google\ChromeVista:C:\Users\UserName\AppDataLocal\Google\ChromeWindows 7:C:\Program Files (x86)\Google\Application\chrome.exe

Update:As mentioned in a comment, it appears the path to chrome.exe has changed in Win7/8. It's now in:C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

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.


You can look in the Registry:

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


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\InstallLocationHKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Google Chrome\InstallLocation

Chrome Canary:

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