Testato in Windows 7 x64: Questa è una procedura in due passaggi. Il browser predefinito dell'utente è in chiave:
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.html\UserChoice\Progid
comune browser Nome chiave:
- IE: IE.AssocFile.HTM
- FireFox: FirefoxHTML
- Chrome: ChromeHTML
- Opera: Opera.HTML
Sostituisci <KEY NAME>
di seguito con uno dei valori sopra per trovare il file eseguibile:
HKCR\<KEY NAME>\shell\open\command
sceneggiatura Autohotkey per visualizzare il percorso browser predefinito e eseguibile:
MsgBox % "Default browser: " Browser()
Browser()
{
; Find the Registry key name for the default browser
RegRead, BrowserKeyName, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.html\UserChoice, Progid
; Find the executable command associated with the above Registry key
RegRead, BrowserFullCommand, HKEY_CLASSES_ROOT, %BrowserKeyName%\shell\open\command
; The above RegRead will return the path and executable name of the brower contained within qoutes and optional parameters
; We only want the text contained inside the first set of quotes which is the path and executable
; Find the ending quote position (we know the beginning quote is in position 0 so start searching at position 1)
StringGetPos, pos, BrowserFullCommand, ",,1
; Decrement by one for the StringMid to work correctly
pos := --pos
; Extract and return the path and executable of the browser
StringMid, BrowserPathandEXE, BrowserFullCommand, 2, %pos%
Return BrowserPathandEXE
}
fonte
2012-09-16 06:50:54
Grazie. Sembra che ho fatto la domanda sbagliata. Quando si fa clic su un file HTML, il browser che si apre è quello che ha registrato il protocollo HTTP, non il browser che si trova nel menu di avvio. Questo ha risolto il mio problema. – soupagain
@soupagain: in realtà, no. Quando fai clic su un file .html ** **, il browser che lo apre è quello che ha registrato l'estensione .html. Quando apri un http: // ** link ** (ad esempio digitandolo nella casella "Start-> Esegui"), il browser che si apre è quello che ha registrato il protocollo HTTP (anche se di solito è lo stesso browser in entrambi i casi). Hai ragione sul fatto che tutto ciò che viene visualizzato nel menu Start non è correlato a questo. – Piskvor
Sì, questo è quello che intendevo dire, ma lo hai spiegato meglio. – soupagain