NuVanDibe Posted April 5, 2006 Share Posted April 5, 2006 Self explanatory, really. You can make this silent with "regedit /s setfirefoxdefault.reg"setfirefoxdefault.reg Link to comment Share on other sites More sharing options...
Djé Posted April 6, 2006 Share Posted April 6, 2006 You can already do it simply by running firefox with the ' -setDefaultBrowser' switch.Starting from v 1.6 (still beta), you will be able to do it unattended: the ' -silent' switch of firefox will work again, so something like the line below will do the trick the right way:"%ProgramFiles%\Mozilla Firefox\firefox.exe" -silent -setDefaultBrowserYou'll have to have a valid profile already defined or add the ' -CreateProfile default' switch, tho. Otherwise, you'll be asked to import IE settings. Link to comment Share on other sites More sharing options...
maxXPsoft Posted April 6, 2006 Share Posted April 6, 2006 NuVanDibe thanksThat will be good for my method of Install Link to comment Share on other sites More sharing options...
Yzöwl Posted April 8, 2006 Share Posted April 8, 2006 There are actually a number of flaws in the reg file posted!1. You may invoke the file accidentally even though you haven't got Firefox installed. Doing so will change many registry keys for no reason, and require a roll back or manual edit to fix.2. PROGRA~1\\MOZILL~1 could be machine specific depending upon your current directory contents. You could have for instance PROGRA~1\\MOZILL~1 for Mozilla Thunderbird. If Firefox is installed and in the default location, then that is unlikely, but still remains a possibility. This of course also highlights the possibility that Firefox may not be installed under 'Program Files' never mind with a folder named 'Mozilla Firefox'3. The data values for HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Desktop may be completely different. The existing data from your current keys are backed up to those keys and are therefore machine specific. You have assumed that the .htm and .html keys had not previously been registered to as another filetype. The StartMenuInternet key may have also been assigned to an application other than Internet Explorer.Taking all these things into account, the registry file would probably be better suited to new unattended builds and or users who always accept the defaults.If you wanted something a little more universal, (for win2k with resource kit and above), try the attached outrageous specimen, it is untested.setfirefoxdefault.cmd Link to comment Share on other sites More sharing options...
maxXPsoft Posted April 10, 2006 Share Posted April 10, 2006 (edited) Taking all these things into account, the registry file would probably be better suited to new unattended builds and or users who always accept the defaults.And for the life of me I cannot understand why anyone would do it otherwise, anal retentive?, think they doin something thats different is best? Because that is so easy it ain't funny, put the stuff where it belongs and anything in the future knows what to do. What part of this do I not understand?I've been doing it the same way from 1.x, yes default Install with a twistTranslatedREG ADD %KEY%\1001 /VE /D "Firefox 1.5 beta 1" /fREG ADD %KEY%\1001 /V 101 /D "CMD /C Start /Wait D:\APPS\Mozilla.Firefox_1.xx\Firefox_autoit.exe" /fREG ADD %KEY%\1001 /V 102 /D "CMD /C Start /Wait SLEEP.EXE 3" /fREG ADD %KEY%\1001 /V 103 /D "CMD /C RD \"%USERPROFILE%\Application Data\Mozilla\" /S /Q"" /fREG ADD %KEY%\1001 /V 104 /D "CMD /C Start /Wait SLEEP.EXE 5" /fREG ADD %KEY%\1001 /V 105 /D "cmd /c XCOPY \"D:\APPS\Mozilla.Firefox_1.xx\Mozilla\" \"%USERPROFILE%\Application Data\Mozilla\" /I /E /H /Y" /fREG ADD %KEY%\1001 /V 106 /D "cmd /c XCOPY \"D:\APPS\Mozilla.Firefox_1.xx\plugins\" \"%ProgramFiles%\Mozilla Firefox\plugins\" /I /E /H /Y" /fREG ADD %KEY%\1001 /V 107 /D "cmd /c XCOPY \"D:\APPS\Mozilla.Firefox_1.xx\searchplugins\" \"%ProgramFiles%\Mozilla Firefox\searchplugins\" /I /E /H /Y" /fREG ADD %KEY%\1001 /V 108 /D "CMD /C Start /Wait D:\APPS\Mozilla.Firefox_1.xx\install_flash_player.exe /S" /fREG ADD %KEY%\1001 /V 109 /D "CMD /C DEL \"%USERPROFILE%\Application Data\Microsoft\Internet Explorer\Quick Launch\Mozilla Firefox.lnk\"" /fREG ADD %KEY%\1001 /V 110 /D "CMD /C DEL \"%ALLUSERSPROFILE%\Application Data\Microsoft\Internet Explorer\Quick Launch\Mozilla Firefox.lnk\"" /fREG ADD %KEY%\1001 /V 111 /D "REGEDIT /S D:\APPS\Mozilla.Firefox_1.xx\setfirefoxdefault.reg" /fWell I'll be danged, complete with everything saved from a previous Install, everything, all my settings, bookmarks, plugins, passwords. I just click a checkbox and all thats done for me but you can see what needs done and modify to your Installand thanks again NuVanDibe for the reg, works for us defaultersEdit: The point of this being do things in the correct order.I'm sure when I decide to get 1.6 I'll use the -setDefaultBrowser Edited April 13, 2006 by maxXPsoft Link to comment Share on other sites More sharing options...
Djé Posted April 11, 2006 Share Posted April 11, 2006 (edited) @maxXPsoft, I'm sure you can wait until 1.6, but just in case you can't wait anymore (this can happen to you if you don't suffer from anal retention ), here is a little suppository of mine that will patch your firefox (if needed) to add the necessary ' -silent' switch (according to Bugzilla) and then apply the ' -setDefaultBrowser'.FirefoxSetDefaultBrowser.cmd@ECHO OFF &SETLOCAL ENABLEEXTENSIONS::javascript file to patchSET "JSTOPATCH=components\nsBrowserContentHandler.js"::javascript line in the file: line to search for deciding to patch or notSET "ESCSEARCH= if (cmdLine.handleFlag(\"silent\", false))"::javascript lines in the file: marker lines to insert the patch afterSET "MARKER1= if (cmdLine.handleFlag("preferences", false)) {"SET "MARKER2= }"::javascript lines in the file: actual patch lines to insertSET "PATCHLINE1= if (cmdLine.handleFlag("silent", false))"SET "PATCHLINE2= cmdLine.preventDefault = true;"::Find Firefox install directory. ©YzöwlFOR /F "TOKENS=3 DELIMS= " %%? IN ( 'REG QUERY "HKLM\SOFTWARE\Mozilla\Mozilla Firefox" /S ^|FINDSTR "\<Install Directory\>" 2^>NUL') DO (IF ERRORLEVEL 0 (SET JSCRIPT=%%~s?%JSTOPATCH%))IF NOT EXIST %JSCRIPT% (ENDLOCAL &GOTO :EOF)::check if the -silent option already exists, if yes, no need to patchFINDSTR /B /C:"%ESCSEARCH%" %JSCRIPT% >nulIF NOT ERRORLEVEL 1 GOTO SETDEFAULT:patch : add the -silent command line option on versions <1.6::according to Bugzilla: [url="https://bugzilla.mozilla.org/show_bug.cgi?id=324023"]https://bugzilla.mozilla.org/show_bug.cgi?id=324023[/url]echo Patching Firefox: re-add the -silent command line option...SET INSERTHERE=NOWAITNOTHEREIF EXIST %JSCRIPT%.patch DEL %JSCRIPT%.patchFOR /F "TOKENS=* DELIMS=" %%? IN (%JSCRIPT%) DO ( >>%JSCRIPT%.patch ECHO\%%? IF "%%?"=="%MARKER1%" SET INSERTHERE=YESHERE IF "%%?"=="%MARKER2%" CALL :SUB_INSERT "%%?")IF EXIST %JSCRIPT%.patch MOVE /Y %JSCRIPT%.patch %JSCRIPT%:SETDEFAULTecho Set Firefox as the default browser...::Find Firefox exe path. ©YzöwlFOR /F "TOKENS=3 DELIMS= " %%? IN ( 'REG QUERY "HKLM\SOFTWARE\Mozilla\Mozilla Firefox" /S ^|FINDSTR "\<PathToExe\>" 2^>NUL') DO (IF ERRORLEVEL 0 (SET SPF=%%~s?))IF NOT DEFINED SPF (ENDLOCAL &GOTO :EOF)::Backup the actual profile folder and create a dummy one (needed by firefox)IF EXIST "%APPDATA%\Mozilla\Firefox" RENAME "%APPDATA%\Mozilla\Firefox" FirefoxTempFolderSetDefaultSTART /WAIT %SPF% -CreateProfile defaultSTART /WAIT %SPF% -silent -setDefaultBrowserPING -n 2 LOCALHOST>nul::Remove the dummy profile and set back the existing one if anyRD /S /Q "%APPDATA%\Mozilla\Firefox" >nulIF EXIST "%APPDATA%\Mozilla\FirefoxTempFolderSetDefault" ( RENAME "%APPDATA%\Mozilla\FirefoxTempFolderSetDefault" Firefox >nul)echo ...Done!pauseENDLOCAL &GOTO :EOF:SUB_INSERT::Patching functionIF NOT "%INSERTHERE%"=="YESHERE" EXIT/B>>%JSCRIPT%.patch ECHO\%PATCHLINE1%>>%JSCRIPT%.patch ECHO\%PATCHLINE2%echo\************ PATCHED ****************SET INSERTHERE=ALREADYDONEEXIT/BFor unattended use, remove the 'pause' after 'echo ...Done!'. All 'echo' lines (with 'echo' in small letters) can also be removed safely.Don't Panic, it's mostly harmless (only known side effects are the disapearing of all the dolphins blank lines and the replacement of the LF endings by CRLF ones inside the patched javascript file. but hey, you don't plan to read it anyway, do you?). Edited April 12, 2006 by Djé Link to comment Share on other sites More sharing options...
maxXPsoft Posted April 13, 2006 Share Posted April 13, 2006 (edited) thanks DjéBut I can wait on the 1.6, prob not that far off.I just hate adding scripts cause sooner or later i'm script(full) or delightfull or one of those full's. Point being when you add so many you kinda loose track of where you goin and where you been and bing bada boom they done updated so back to modify what worked in the first place.Its the difference between a script which may crash somewhere down the line and -setDefaultBrowser, easy choice for meThe reg works fine here Edited April 13, 2006 by maxXPsoft Link to comment Share on other sites More sharing options...
Djé Posted April 14, 2006 Share Posted April 14, 2006 (edited) Yes, it's coming closer: version 1.5.0.2 has been released without the bug fix for -silent yet But with a possibility to bypass the import IE setting wizard. I'll investigate.Hopefully, it should be in the next version (file version:1.8.0.3 while actual is 1.8.0.2).Anyway, you're true about those scripts files everywhere. But then, reg files are the same. So one or another, as long as it works...cheers Edited April 14, 2006 by Djé Link to comment Share on other sites More sharing options...
HyperHacker Posted April 23, 2006 Share Posted April 23, 2006 I think 1.5.0.2 was just to fix some exploits. Link to comment Share on other sites More sharing options...
twizt3d Posted April 29, 2006 Share Posted April 29, 2006 FirefoxSetDefaultBrowser.cmd@ECHO OFF &SETLOCAL ENABLEEXTENSIONS::javascript file to patchSET "JSTOPATCH=components\nsBrowserContentHandler.js"::javascript line in the file: line to search for deciding to patch or notSET "ESCSEARCH= if (cmdLine.handleFlag(\"silent\", false))"::javascript lines in the file: marker lines to insert the patch afterSET "MARKER1= if (cmdLine.handleFlag("preferences", false)) {"SET "MARKER2= }"::javascript lines in the file: actual patch lines to insertSET "PATCHLINE1= if (cmdLine.handleFlag("silent", false))"SET "PATCHLINE2= cmdLine.preventDefault = true;"::Find Firefox install directory. ©YzöwlFOR /F "TOKENS=3 DELIMS= " %%? IN ( 'REG QUERY "HKLM\SOFTWARE\Mozilla\Mozilla Firefox" /S ^|FINDSTR "\<Install Directory\>" 2^>NUL') DO (IF ERRORLEVEL 0 (SET JSCRIPT=%%~s?%JSTOPATCH%))IF NOT EXIST %JSCRIPT% (ENDLOCAL &GOTO :EOF)::check if the -silent option already exists, if yes, no need to patchFINDSTR /B /C:"%ESCSEARCH%" %JSCRIPT% >nulIF NOT ERRORLEVEL 1 GOTO SETDEFAULT:patch : add the -silent command line option on versions <1.6::according to Bugzilla: [url="https://bugzilla.mozilla.org/show_bug.cgi?id=324023"]https://bugzilla.mozilla.org/show_bug.cgi?id=324023[/url]echo Patching Firefox: re-add the -silent command line option...SET INSERTHERE=NOWAITNOTHEREIF EXIST %JSCRIPT%.patch DEL %JSCRIPT%.patchFOR /F "TOKENS=* DELIMS=" %%? IN (%JSCRIPT%) DO ( >>%JSCRIPT%.patch ECHO\%%? IF "%%?"=="%MARKER1%" SET INSERTHERE=YESHERE IF "%%?"=="%MARKER2%" CALL :SUB_INSERT "%%?")IF EXIST %JSCRIPT%.patch MOVE /Y %JSCRIPT%.patch %JSCRIPT%:SETDEFAULTecho Set Firefox as the default browser...::Find Firefox exe path. ©YzöwlFOR /F "TOKENS=3 DELIMS= " %%? IN ( 'REG QUERY "HKLM\SOFTWARE\Mozilla\Mozilla Firefox" /S ^|FINDSTR "\<PathToExe\>" 2^>NUL') DO (IF ERRORLEVEL 0 (SET SPF=%%~s?))IF NOT DEFINED SPF (ENDLOCAL &GOTO :EOF)::Backup the actual profile folder and create a dummy one (needed by firefox)IF EXIST "%APPDATA%\Mozilla\Firefox" RENAME "%APPDATA%\Mozilla\Firefox" FirefoxTempFolderSetDefaultSTART /WAIT %SPF% -CreateProfile defaultSTART /WAIT %SPF% -silent -setDefaultBrowserPING -n 2 LOCALHOST>nul::Remove the dummy profile and set back the existing one if anyRD /S /Q "%APPDATA%\Mozilla\Firefox" >nulIF EXIST "%APPDATA%\Mozilla\FirefoxTempFolderSetDefault" ( RENAME "%APPDATA%\Mozilla\FirefoxTempFolderSetDefault" Firefox >nul)echo ...Done!pauseENDLOCAL &GOTO :EOF:SUB_INSERT::Patching functionIF NOT "%INSERTHERE%"=="YESHERE" EXIT/B>>%JSCRIPT%.patch ECHO\%PATCHLINE1%>>%JSCRIPT%.patch ECHO\%PATCHLINE2%echo\************ PATCHED ****************SET INSERTHERE=ALREADYDONEEXIT/BFor unattended use, remove the 'pause' after 'echo ...Done!'. All 'echo' lines (with 'echo' in small letters) can also be removed safely.Could you write one for thunderbird? Link to comment Share on other sites More sharing options...
urie Posted May 1, 2006 Share Posted May 1, 2006 (edited) Well i used setfirefoxdefault.reg file posted and spent a day trying to get .htm and .html files sorted they had no icons luckily i found this vbs script on the net'--------------------------------------------------------------'Applies To : Microsoft Windows XP'Author : Ramesh Srinivasan - Microsoft MVP [Windows XP]'Created on : January 17, 2006'Description : Fixes the icons for HTM/HTML/MHT/MHTML files'Homepage : http://windowsxp.mvps.org'More Info : http://windowsxp.mvps.org/htmicon.htm'Prerequisite : Windows XP systems / Administrative privileges'--------------------------------------------------------------Set WshShell = CreateObject("WScript.Shell")On Error resume NextWshShell.RegWrite "HKCR\.htm\", "htmlfile", "REG_SZ"WshShell.RegWrite "HKCR\.html\", "htmlfile", "REG_SZ"WshShell.RegWrite "HKCR\.mht\", "mhtmlfile", "REG_SZ"WshShell.RegWrite "HKCR\.mhtml\", "mhtmlfile", "REG_SZ"WshShell.RegWrite "HKCR\htmlfile\DefaultIcon\", "%Programfiles%\Internet Explorer\IEXPLORE.EXE,1", "REG_EXPAND_SZ"WshShell.RegWrite "HKCR\mhtmlfile\DefaultIcon\", "%Programfiles%\Internet Explorer\IEXPLORE.EXE,22", "REG_EXPAND_SZ"WshShell.Regdelete "HKCR\htmlfile\ShellEx\IconHandler\"WshShell.Regdelete "HKCR\mhtmlfile\ShellEx\IconHandler\"WshShell.Regdelete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.HTM\Application"WshShell.Regdelete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.HTM\ProgID"WshShell.Regdelete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.HTML\Application"WshShell.Regdelete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.HTML\ProgID"WshShell.RegWrite "HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths\IEXPLORE.EXE\", "%Programfiles%\Internet Explorer\IEXPLORE.EXE", "REG_EXPAND_SZ"Wshshell.RUN ("regsvr32.exe mshtml.dll -i -s")Wshshell.RUN ("regsvr32.exe shdocvw.dll -i -s")MsgUser = Msgbox ("Fixed the registry settings. Restart Windows for the changes to take effect", 4160, "HTML icon fix for Windows XP")Set WshShell = Nothing Edited May 1, 2006 by urie Link to comment Share on other sites More sharing options...
Yzöwl Posted May 1, 2006 Share Posted May 1, 2006 urie, who have you quoted? no-one in this thread appears to have said that!Also why would a script which associates filetypes etc. with IE be of any use to Firefox users. Link to comment Share on other sites More sharing options...
urie Posted May 1, 2006 Share Posted May 1, 2006 Yzöwl i used the reg file posted herehttp://www.msfn.org/board/index.php?s=&showtopic=71739&view=findpost&p=490133Also why would a script which associates filetypes etc. with IE be of any use to Firefox users.i had to use the vbs script i posted to get registry setting back to default as i said there were no icons on html or htm files not even when firefox was set to default browser. Link to comment Share on other sites More sharing options...
Djé Posted June 4, 2006 Share Posted June 4, 2006 (edited) Well No need to wait for 1.6.firefox 1.5.0.4 is out and implements the -silent switch.So attached should be the definitive -setDefaultBrowser.cmdIt is designed to work in a very broad variety of situations.If you find it non working in yours, I'd be curious to know about...Firefox_setDefaultBrowser.cmd Edited June 4, 2006 by Djé Link to comment Share on other sites More sharing options...
Djé Posted July 10, 2006 Share Posted July 10, 2006 (edited) Here we go! This is the one for Thunderbird.Although Tb has a 'setDefaultMail' switch, it doesn't look like it's working.So this script is doing it the historic way: DIY reg entries.It uses the REG command, so it's not suitable for vanilla win2K.Use it with the -h or /help switch to display the help message which will give you the different options.setDefaultMail.cmd Edited July 10, 2006 by Djé Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now