PortableApps.com Platform and Suite 1.6 have been released.

Firefox Multiple Profiles : the easy way

Submitted by Fxp on August 7, 2008 - 6:22am

You can have multiple portable profiles in three little steps. Still, you won't be able to run them at the same time.

STEP 1 : Create the profiles

The normal architecture of the firefox portable folder is:

-FirefoxPortable
   -App
   -Data
   -Other

You need to create multiple "Data" folders (one for each profile) in firefox portable. You can either keep "Data" as the default folder, or just erase it. You can name the folders as you wish. You can replace profile1, profile2, profile3, by Serious, Naughty, extensionTester if you prefer.

-FirefoxPortable
   -App
   -Profile1
   -Profile2
   -Profile3
   -Other

The pofiles folders are empty. This is normal. Firefox will fill them with the default profile content (stored in the app folder, if you want to check).
If you want to put your existing profiles datas, it is the right moment. Just paste the content of your profiles, in the folders.

STEP 2 : Create the ini files

Firfox Portable apps configuration can be changed through a file called FirefoxPortable.ini
Fetch the one in FirefoxPortable / Other / Sources and copy it in the FirefoxPortable folder.

If you edit it, you see that two lines are pointing at the old Data folder.
Save three copies of this file in the same directory, after changing the "Data" name to your corresponding profile:

  • FirefoxPortableProfile1.ini :
    ProfileDirectory=Profile1\profile
    SettingsDirectory=Profile1\settings
    
  • FirefoxPortableProfile2.ini :
    ProfileDirectory=Profile2\profile
    SettingsDirectory=Profile2\settings
    
  • etc...

STEP 3 : Start them

Ok, you just have to create a little .bat file to overwrite the FirefoxPortable.ini with the ini of the profile you want to use.

Profile1.bat

copy /Y FirefoxPortableProfile1.ini FirefoxPortable.ini
FirefoxPortable

(don't forget to add a carriage return after the last line, otherwise it will not be executed)

You can have as many bat to start all your profiles, or you can create a more complicated bat which will ask you which profile you want to start.

Hope it helps

Fxparlant


( categories: )

multiple profiles bat file

you can create a dos file call it what you want (let say: firefox.bat) which will help you switch profiles, as long as you have created them as explained in the previous post:

Firefox.bat

@echo off
echo Which profile: 1, 2 or 3 ?
set /p Input=
if /i "%Input%"=="1" (goto Profile1)
if /i "%Input%"=="2" (goto Profile2)
if /i "%Input%"=="2" (goto Profile3)
REM if /i not "%Input%"=="y" (exit /b)
exit /b
:Profile1
copy /Y FirefoxPortableProfile1.ini FirefoxPortable.ini
FirefoxPortable
exit /b

:Profile2
copy /Y FirefoxPortableProfile2.ini FirefoxPortable.ini
FirefoxPortable
exit /b

:Profile3
copy /Y FirefoxPortableProfile3.ini FirefoxPortable.ini
FirefoxPortable
exit /b

Hope this helps.

Fxparlant

More complicated bat file - simpler process

1. Amend folder structure as so:

-FirefoxPortable
    -App
    -Data
        -default
            -plugins
            -profile
            -settings
        -dev
            -plugins
            -profile
            -settings
        -light
            -plugins
            -profile
            -settings
    -Other

2. Put bat file in PortableFirefox folder and run!

3. (optional) place "Parameters.txt" in each new folder with a single line of command line parameters to pass to Firefox (e.g. -no-remote for dev profile).

.bat

@echo off
cls

:: Set MYPATH to Bat file directory
set MYPATH=%~dp0

:: Set the file where you profile list will be stored
set TMPTXT=%TMP%\FFprofiles_tmp.txt
:: Make sure it doesn't exist
if exist "%TMPTXT%" del "%TMPTXT%"


:: Store list of folders in \Data to FFprofiles_tmp.txt
dir "%MYPATH%Data" /AD /B /ON /P > "%TMPTXT%"

:SELECT
echo Available profiles:
echo.

setlocal enabledelayedexpansion
set choices=0
set i=0
for /f "usebackq delims=" %%a in ("%TMPTXT%") do (
set /a i+=1
set choices=!choices!,!i!
echo 	!i! %%a
)
set choices=%choices%,

echo.

set /p profile=Select by number (0 to exit):
if %profile%==0 goto END
if "%choices%"=="!choices:,%profile%,=!" (
echo Incorrect selection
pause
cls
goto SELECT
)


:RUN
set i=0
for /f "usebackq delims=" %%a in ("%TMPTXT%") do (
set /a i+=1
if !i!==%profile% set profile=%%a
)
echo Opening "%profile%" profile...

:: Check if FirefoxPortable.ini exists in current folder and copies from Other\source if not
if not exist "%MYPATH%FirefoxPortable.ini" copy /-Y "%MYPATH%Other\Source\FirefoxPortable.ini" "%MYPATH%FirefoxPortable.ini"

:: Start afresh with temp file
del "%TMPTXT%"

set params=
if exist "%MYPATH%Data\%profile%\Parameters.txt" set /P params=<"%MYPATH%Data\%profile%\Parameters.txt"


for /f "usebackq delims=" %%a in ("%MYPATH%FirefoxPortable.ini") do (
	set line=%%a
		for /f "tokens=1* delims=\" %%g in ("%%a") do (
			if "%%g"=="ProfileDirectory=Data" set line=ProfileDirectory=Data\%profile%\profile
		)
		for /f "tokens=1* delims=\" %%g in ("%%a") do (
			if "%%g"=="SettingsDirectory=Data" set line=SettingsDirectory=Data\%profile%\settings
		)
		for /f "tokens=1* delims=\" %%g in ("%%a") do (
			if "%%g"=="PluginsDirectory=Data" set line=PluginsDirectory=Data\%profile%\plugins
		)
		for /f "tokens=1* delims==" %%g in ("%%a") do (
			if "%%g"=="AdditionalParameters" set line=AdditionalParameters=%params%
		)
	echo.!line!>>"%TMPTXT%"
)

copy /Y "%TMPTXT%" "%MYPATH%FirefoxPortable.ini"

START /B .\FirefoxPortable.exe

:END
del "%TMPTXT%"
exit /B

EDIT: If you change the folder names of your new profiles after first run against that profile firefoxportable won't find your extensions properly...
Deleting .\Data\*folder*\profile\compatibility.ini and .\Data\*folder*\profile\extensions.ini after changing folder name seems to sort this out.

Thank's ! There's also

Thank's !

There's also AndreasSeitz Portable profiles tool here: http://portableapps.com/node/5376#comment-112474

To whitch I propose some changes that make it work quite like the native FF profile manager :
http://portableapps.com/node/5376#comment-133358