Как установить браузер по умолчанию с аргументами командной строки через скрипт или батник?
Нашел несколько вариантов, но они все правят разные ветки реестра. Как такое может быть?
http://blogs.msdn.com/b/akshayns/archive/2009/10/15/a-batch-file-for-setting-ie-as-the-default-browser.aspx [more]
:: .htm extension
reg add "HKCU\Software\Classes\.htm" /t REG_SZ /d "htmlfile" /ve /f
:: .html extension
reg add "HKCU\Software\Classes\.html" /t REG_SZ /d "htmlfile" /ve /f
:: http shell
reg add "HKCU\Software\Classes\http\shell\open\command" /t REG_SZ /d "\"C:\Program Files\Internet Explorer\IEXPLORE.EXE\" -nohome" /ve /f
:: ftp shell
reg add "HKCU\Software\Classes\ftp\shell\open\command" /t REG_SZ /d "\"C:\Program Files\Internet Explorer\IEXPLORE.EXE\" %%1" /ve /f
:: https shell
reg add "HKCU\Software\Classes\https\shell\open\command" /t REG_SZ /d "\"C:\Program Files\Internet Explorer\IEXPLORE.EXE\" -nohome" /ve /f
:: http class
reg delete "HKCU\Software\Classes\http\DefaultIcon" /ve /f
reg add "HKCU\Software\Classes\http\DefaultIcon" /t REG_EXPAND_SZ /d "%%SystemRoot%%\system32\url.dll,0" /ve /f
:: ftp class
reg delete "HKCU\Software\Classes\ftp\DefaultIcon" /ve /f
reg add "HKCU\Software\Classes\ftp\DefaultIcon" /t REG_EXPAND_SZ /d "%%SystemRoot%%\system32\url.dll,0" /ve /f
:: https class
reg delete "HKCU\Software\Classes\https\DefaultIcon" /ve /f
reg add "HKCU\Software\Classes\https\DefaultIcon" /t REG_EXPAND_SZ /d "%%SystemRoot%%\system32\url.dll,0" /ve /f
:: ddeexec keys
reg add "HKCU\Software\Classes\http\shell\open\ddeexec" /t REG_SZ /d "\"%%1\",,-1,0,,,," /ve /f
reg add "HKCU\Software\Classes\ftp\shell\open\ddeexec" /t REG_SZ /d "\"%%1\",,-1,0,,,," /ve /f
reg add "HKCU\Software\Classes\https\shell\open\ddeexec" /t REG_SZ /d "\"%%1\",,-1,0,,,," /ve /f
:: StartMenuInternet key
reg delete "HKCU\Software\Clients\StartMenuInternet" /ve /ve /f
reg add "HKLM\Software\Clients\StartMenuInternet" /t REG_SZ /d "IEXPLORE.EXE" /ve /f
:: ddeexec app keys
reg add "HKCR\HTTP\shell\open\ddeexec\Application" /t REG_SZ /d "IExplore" /ve /f
reg add "HKCR\HTTPS\shell\open\ddeexec\Application" /t REG_SZ /d "IExplore" /ve /f
reg add "HKCR\FTP\shell\open\ddeexec\Application" /t REG_SZ /d "IExplore" /ve /f
reg add "HKCR\htmlfile\shell\open\ddeexec\Application" /t REG_SZ /d "IExplore" /ve /f
reg add "HKCR\htmlfile\shell\opennew\ddeexec\Application" /t REG_SZ /d "IExplore" /ve /f
reg add "HKCR\mhtmlfile\shell\open\ddeexec\Application" /t REG_SZ /d "IExplore" /ve /f
reg add "HKCR\mhtmlfile\shell\opennew\ddeexec\Application" /t REG_SZ /d "IExplore" /ve /f
:: ifexec keys
reg add "HKLM\SOFTWARE\Classes\ftp\shell\open\ddeexec\ifExec" /t REG_SZ /d "*" /ve /f
[/more]
https://social.technet.microsoft.com/Forums/ru-RU/4d57de50-836a-4351-a0f7-5fed58b3bc54/ie8-64?forum=windows7ru [more]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\HTTP]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\HTTP\DefaultIcon]
@="\"C:\\Program Files\\Mozilla Firefox\\firefox.exe\",1"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\HTTP\shell]
@="Firefox"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\HTTP\shell\Firefox]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\HTTP\shell\Firefox\command]
@="\"C:\\Program Files\\Mozilla Firefox\\firefox.exe\" -requestPending -osint -url \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\HTTP\shell\Firefox\ddeexec]
@="\"%1\",,0,0,,,,"
"NoActivateHandler"=""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\HTTP\shell\Firefox\ddeexec\Application]
@="Firefox"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\HTTP\shell\Firefox\ddeexec\Topic]
@="WWW_OpenURL"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\HTTP\shell\open]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\HTTP\shell\open\command]
@="\"C:\\Program Files\\Mozilla Firefox\\firefox.exe\" -requestPending -osint -url \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\HTTP\shell\open\ddeexec]
@="\"%1\",,0,0,,,,"
"NoActivateHandler"=""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\HTTP\shell\open\ddeexec\Application]
@="Firefox"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\HTTP\shell\open\ddeexec\Topic]
@="WWW_OpenURL"
; ====================================================================================================
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\https]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\https\DefaultIcon]
@="\"C:\\Program Files\\Mozilla Firefox\\firefox.exe\",1"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\https\shell]
@="Firefox"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\https\shell\Firefox]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\https\shell\Firefox\command]
@="\"C:\\Program Files\\Mozilla Firefox\\firefox.exe\" -requestPending -osint -url \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\https\shell\Firefox\ddeexec]
@="\"%1\",,0,0,,,,"
"NoActivateHandler"=""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\https\shell\Firefox\ddeexec\Application]
@="Firefox"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\https\shell\Firefox\ddeexec\Topic]
@="WWW_OpenURL"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\https\shell\open]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\https\shell\open\command]
@="\"C:\\Program Files\\Mozilla Firefox\\firefox.exe\" -requestPending -osint -url \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\https\shell\open\ddeexec]
@="\"%1\",,0,0,,,,"
"NoActivateHandler"=""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\https\shell\open\ddeexec\Application]
@="Firefox"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\https\shell\open\ddeexec\Topic]
@="WWW_OpenURL"
[/more]
http://portableapps.com/node/23082 [more]
Solution (Windows 7)
1) chrome.reg:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\RegisteredApplications]
"Chrome Portable"="Software\\Clients\\StartMenuInternet\\GoogleChromePortable\\Capabilities"
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\GoogleChromePortable\Capabilities]
"ApplicationName"="Google Chrome Portable"
"ApplicationDescription"="Google Chrome Portable is a web browser that runs web pages and applications with lightning speed. It's designed to be simple and stylish. It's packaged as a portable app, so you can take your browsing experience with you."
"ApplicationIcon"="\"D:\\Softwares\\Portable\\Extracted\\GoogleChromePortable\\GoogleChromePortable.exe\",0"
"Hidden"=dword:00000000
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\GoogleChromePortable\Capabilities\FileAssociations]
".htm"="GoogleChromePortableHTML"
".html"="GoogleChromePortableHTML"
".shtml"="GoogleChromePortableHTML"
".xht"="GoogleChromePortableHTML"
".xhtml"="GoogleChromePortableHTML"
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\GoogleChromePortable\Capabilities\StartMenu]
"StartMenuInternet"="GoogleChromePortable"
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\GoogleChromePortable\Capabilities\URLAssociations]
"http"="GoogleChromePortableURL"
"https"="GoogleChromePortableURL"
"ftp"="GoogleChromePortableURL"
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\GoogleChromePortable]
"LocalizedString"="Google Chrome Portable"
""="Google Chrome Portable"
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\GoogleChromePortable\DefaultIcon]
""="\"D:\\Softwares\\Portable\\Extracted\\GoogleChromePortable\\GoogleChromePortable.exe\",0"
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\GoogleChromePortable\shell\open\command]
""="\"D:\\Softwares\\Portable\\Extracted\\GoogleChromePortable\\GoogleChromePortable.exe\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\GoogleChromePortable\shell\properties\command]
""="\"D:\\Softwares\\Portable\\Extracted\\GoogleChromePortable\\GoogleChromePortable.exe\" -preferences"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\GoogleChromePortableURL]
""="Google Chrome Portable URL"
"URL Protocol"=""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\GoogleChromePortableURL\DefaultIcon]
""=hex(2):22,00,44,00,3A,00,5C,00,53,00,6F,00,66,00,74,00,77,00,61,00,72,00,\
65,00,73,00,5C,00,50,00,6F,00,72,00,74,00,61,00,62,00,6C,00,65,00,5C,00,45,\
00,78,00,74,00,72,00,61,00,63,00,74,00,65,00,64,00,5C,00,47,00,6F,00,6F,00,\
67,00,6C,00,65,00,43,00,68,00,72,00,6F,00,6D,00,65,00,50,00,6F,00,72,00,74,\
00,61,00,62,00,6C,00,65,00,5C,00,47,00,6F,00,6F,00,67,00,6C,00,65,00,43,00,\
68,00,72,00,6F,00,6D,00,65,00,50,00,6F,00,72,00,74,00,61,00,62,00,6C,00,65,\
00,2E,00,65,00,78,00,65,00,22,00,2C,00,30,00,00,00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\GoogleChromePortableURL\shell\open\command]
""=hex(2):22,00,44,00,3A,00,5C,00,53,00,6F,00,66,00,74,00,77,00,61,00,72,00,\
65,00,73,00,5C,00,50,00,6F,00,72,00,74,00,61,00,62,00,6C,00,65,00,5C,00,45,\
00,78,00,74,00,72,00,61,00,63,00,74,00,65,00,64,00,5C,00,47,00,6F,00,6F,00,\
67,00,6C,00,65,00,43,00,68,00,72,00,6F,00,6D,00,65,00,50,00,6F,00,72,00,74,\
00,61,00,62,00,6C,00,65,00,5C,00,47,00,6F,00,6F,00,67,00,6C,00,65,00,43,00,\
68,00,72,00,6F,00,6D,00,65,00,50,00,6F,00,72,00,74,00,61,00,62,00,6C,00,65,\
00,2E,00,65,00,78,00,65,00,22,00,20,00,2D,00,75,00,72,00,6C,00,20,00,22,00,\
25,00,31,00,22,00,00,00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\GoogleChromePortableHTML]
""="Google Chrome HTML"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\GoogleChromePortableHTML\DefaultIcon]
""="\"D:\\Softwares\\Portable\\Extracted\\GoogleChromePortable\\GoogleChromePortable.exe\",0"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\GoogleChromePortableHTML\shell\open\command]
""="\"D:\\Softwares\\Portable\\Extracted\\GoogleChromePortable\\GoogleChromePortable.exe\" -url \"%1\""
2) Control Panel -> Default Programs -> Google Chrome Portable -> Set this program as default.
[/more]
http://portableapps.com/node/37743 [more]
предлагаются утилиты
http://www.winhelponline.com/blog/register-firefox-portable-with-default-programs-in-vista/ http://www.winhelponline.com/blog/how-to-set-firefox-portable-as-the-default-browser-in-windows-xp/ http://code.google.com/p/padp/downloads/detail?name=DefaultMyFFP-1.5.zip [/more]
[more]
non-working solution
https://social.technet.microsoft.com/Forums/windows/en-US/366fd8d6-ff5c-47c5-8a80-6705f4b36186/how-can-i-get-chrome-as-the-default-browser-to-survive-the-profile-copying-process-in-windows-xp?forum=itproxpsp non-working solution
https://code.google.com/p/qtweb/issues/attachmentText?id=2&aid=20003000&name=SetDefaultBrowser.test.bat&token=ABZ6GAfgYczdoLItLUvRGfYYA0fzyFJ_Kw%3A1437896608591 [/more]
Добавлено: Напр. есть некий HTML_VIEWER.exe. Что и куда писать, чтобы сделать его браузером по умолчанию, и чтобы он запускался всегда с путем
Код: "C:\HTML_VIEWER.exe" -CommandLineOption1="C:\data\" -CommandLineOption2