Universal path to chrome.exe

前端 未结 7 1344
失恋的感觉
失恋的感觉 2020-12-29 04:15

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 c

相关标签:
7条回答
  • 2020-12-29 04:46

    You can look in the Registry:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe
    
    0 讨论(0)
  • 2020-12-29 04:46

    This is the correct path:

    C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
    
    0 讨论(0)
  • 2020-12-29 04:48

    I had an .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 :)

    0 讨论(0)
  • 2020-12-29 04:49

    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.

    0 讨论(0)
  • 2020-12-29 04:52

    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.

    0 讨论(0)
  • 2020-12-29 04:55

    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
    
    0 讨论(0)
提交回复
热议问题