Add Firefox Portable to Default Apps

Portable apps should not be added to Windows Shell default programs via their own menu or settings, as this may break things.

To add Firefox Portable from PortableApps to your Windows Default Apps list, place the following command file in the same folder where FirefoxPortable.exe launcher is and run it with admin privileges
@Echo Off
Title FirefoxPortable to Default Browser
echo Run in the same folder with FirefoxPortable.exe
cd %systemroot%\system32
call :IsAdmin

Reg.exe add "HKLM\SOFTWARE\RegisteredApplications" /v "Firefox Portable" /t REG_SZ /d "Software\Clients\StartMenuInternet\FirefoxPortable\Capabilities" /f
Reg.exe add "HKLM\SOFTWARE\Clients\StartMenuInternet\FirefoxPortable\Capabilities" /v "ApplicationName" /t REG_SZ /d "Firefox Portable" /f
Reg.exe add "HKLM\SOFTWARE\Clients\StartMenuInternet\FirefoxPortable\Capabilities" /v "ApplicationDescription" /t REG_SZ /d "Firefox Portable" /f
Reg.exe add "HKLM\SOFTWARE\Clients\StartMenuInternet\FirefoxPortable\Capabilities" /v "ApplicationIcon" /t REG_SZ /d "\"%~dp0FirefoxPortable.exe\",0" /f
Reg.exe add "HKLM\SOFTWARE\Clients\StartMenuInternet\FirefoxPortable\Capabilities" /v "Hidden" /t REG_DWORD /d "0" /f
Reg.exe add "HKLM\SOFTWARE\Clients\StartMenuInternet\FirefoxPortable\Capabilities\FileAssociations" /v ".htm" /t REG_SZ /d "FirefoxPortableHTML" /f
Reg.exe add "HKLM\SOFTWARE\Clients\StartMenuInternet\FirefoxPortable\Capabilities\FileAssociations" /v ".html" /t REG_SZ /d "FirefoxPortableHTML" /f
Reg.exe add "HKLM\SOFTWARE\Clients\StartMenuInternet\FirefoxPortable\Capabilities\FileAssociations" /v ".shtml" /t REG_SZ /d "FirefoxPortableHTML" /f
Reg.exe add "HKLM\SOFTWARE\Clients\StartMenuInternet\FirefoxPortable\Capabilities\FileAssociations" /v ".xht" /t REG_SZ /d "FirefoxPortableHTML" /f
Reg.exe add "HKLM\SOFTWARE\Clients\StartMenuInternet\FirefoxPortable\Capabilities\FileAssociations" /v ".xhtml" /t REG_SZ /d "FirefoxPortableHTML" /f
Reg.exe add "HKLM\SOFTWARE\Clients\StartMenuInternet\FirefoxPortable\Capabilities\StartMenu" /v "StartMenuInternet" /t REG_SZ /d "FirefoxPortable" /f
Reg.exe add "HKLM\SOFTWARE\Clients\StartMenuInternet\FirefoxPortable\Capabilities\URLAssociations" /v "http" /t REG_SZ /d "FirefoxPortableURL" /f
Reg.exe add "HKLM\SOFTWARE\Clients\StartMenuInternet\FirefoxPortable\Capabilities\URLAssociations" /v "https" /t REG_SZ /d "FirefoxPortableURL" /f
Reg.exe add "HKLM\SOFTWARE\Clients\StartMenuInternet\FirefoxPortable\Capabilities\URLAssociations" /v "ftp" /t REG_SZ /d "FirefoxPortableURL" /f
Reg.exe add "HKLM\SOFTWARE\Clients\StartMenuInternet\FirefoxPortable" /v "LocalizedString" /t REG_SZ /d "Firefox Portable" /f
Reg.exe add "HKLM\SOFTWARE\Clients\StartMenuInternet\FirefoxPortable" /ve /t REG_SZ /d "Firefox Portable" /f
Reg.exe add "HKLM\SOFTWARE\Clients\StartMenuInternet\FirefoxPortable\DefaultIcon" /ve /t REG_SZ /d "\"%~dp0FirefoxPortable.exe\",0" /f
Reg.exe add "HKLM\SOFTWARE\Clients\StartMenuInternet\FirefoxPortable\shell\open\command" /ve /t REG_SZ /d "\"%~dp0FirefoxPortable.exe\"" /f
Reg.exe add "HKLM\SOFTWARE\Clients\StartMenuInternet\FirefoxPortable\shell\properties\command" /ve /t REG_SZ /d "\"%~dp0FirefoxPortable.exe\" -preferences" /f
Reg.exe add "HKLM\SOFTWARE\Classes\FirefoxPortableURL" /ve /t REG_SZ /d "Firefox Portable URL" /f
Reg.exe add "HKLM\SOFTWARE\Classes\FirefoxPortableURL" /v "URL Protocol" /t REG_SZ /d "" /f
Reg.exe add "HKLM\SOFTWARE\Classes\FirefoxPortableURL\DefaultIcon" /ve /t REG_SZ /d "\"%~dp0FirefoxPortable.exe\",0" /f
Reg.exe add "HKLM\SOFTWARE\Classes\FirefoxPortableURL\shell\open\command" /ve /t REG_SZ /d "\"%~dp0FirefoxPortable.exe\" -url \"%%1\"" /f
Reg.exe add "HKLM\SOFTWARE\Classes\FirefoxPortableHTML" /ve /t REG_SZ /d "Firefox Portable HTML" /f
Reg.exe add "HKLM\SOFTWARE\Classes\FirefoxPortableHTML\DefaultIcon" /ve /t REG_SZ /d "\"%~dp0FirefoxPortable.exe\",0" /f
Reg.exe add "HKLM\SOFTWARE\Classes\FirefoxPortableHTML\shell\open\command" /ve /t REG_SZ /d "\"%~dp0FirefoxPortable.exe\" -url \"%%1\"" /f
Exit

:IsAdmin
Reg.exe query "HKU\S-1-5-19\Environment"
If Not %ERRORLEVEL% EQU 0 (
Cls & Echo You must have administrator rights to continue ...
Pause & Exit
)
Cls
goto:eof

Then reboot your PC. After reboot, Firefox Portable should appear as a separate item in default programs list, and you should be able to select it as default browser for everything, including HTTP HTTPS FTP protocols.

Download the batch file here (unzip, place in the same folder as Firefox Portable launcher and run as admin)

Leave a Comment