:: Set Firefox as the default Internet browser, both system-wide and :: for the current user. Should work correctly for the current user :: even if changes to system-wide registry keys are not allowed. :: Tested with Firefox 3.6. :: :: Stephen Thomas 2-Feb-2010 :: :: This is free software. Do whatever you like with it except hold :: me accountable for any grief it causes you. @setlocal enabledelayedexpansion @for /f "tokens=3 delims=. " %%A in ('echo') do @set echo=%%A @echo off :: Fix these for your local installation set app=Firefox set exe=%ProgramFiles%\Mozilla Firefox\firefox.exe set menuname=FIREFOX.EXE :: Update this from HKCU\SOFTWARE\Classes\HTTP\shell\open\command :: if this script makes Firefox claim not to be the default browser. :: Write " as \" and % as %% to keep the cmd interpreter happy. set opencmd=\"%exe%\" -requestPending -osint -url \"%%1\" set set=reg add set to=/ve /d set or die=/f 1^>nul ^|^| goto end for %%H in (HKCU HKLM) do ( set software=%%H\SOFTWARE set key=!software!\Classes for %%K in (ftp HTTP https) do ( %set% "!key!\%%K\shell\open\command" %to% "%opencmd%" %or die% %set% "!key!\%%K\shell\open\ddeexec" %to% "\"%%1\",,0,0,,,," %or die% %set% "!key!\%%K\shell\open\ddeexec\Application" %to% "%app%" %or die% %set% "!key!\%%K\DefaultIcon" %to% "%exe%,1" %or die% ) for %%K in (htm html shtml xht xhtml) do %set% "!key!\.%%K" %to% "FirefoxHTML" %or die% set key=!software!\Clients\StartMenuInternet %set% "!key!\!menuname!\DefaultIcon" %to% "%exe%,0" %or die% %set% "!key!\!menuname!\shell\open\command" %to% "\"%exe%\"" %or die% %set% "!key!\!menuname!\shell\properties" %to% "%app% &Options" %or die% %set% "!key!\!menuname!\shell\properties\command" %to% "\"%exe%\" -preferences" %or die% %set% "!key!\!menuname!\shell\safemode" %to% "%app% in &Safe Mode" %or die% %set% "!key!\!menuname!\shell\safemode\command" %to% "\"%exe%\" -safe-mode" %or die% %set% "!key!" %to% "!menuname!" %or die% ) :end @echo %echo% @endlocal