Universal path to chrome.exe

Sirine Hlima picture Sirine Hlima · Jul 19, 2013 · Viewed 89.4k times · Source

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 )

Answer

J. Scott Elblein picture J. Scott Elblein · Dec 23, 2013

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\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.