You are here

Firefox Multiple Profiles : the easy way

15 posts / 0 new
Last post
Fxp
Offline
Last seen: 16 years 3 months ago
Joined: 2008-03-07 10:44
Firefox Multiple Profiles : the easy way

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

Fxp
Offline
Last seen: 16 years 3 months ago
Joined: 2008-03-07 10:44
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

hutchinsfairy
Offline
Last seen: 5 years 8 months ago
Joined: 2008-08-15 07:51
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=>"%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.

Fondary
Offline
Last seen: 15 years 1 day ago
Joined: 2009-11-13 17:22
Thank's ! There's also

Thank's !

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

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

fe1ix.th3.c4t
fe1ix.th3.c4t's picture
Offline
Last seen: 5 years 11 months ago
Joined: 2018-12-06 21:46
sorry for the necrophilia

but I faced a similar problem. I came across this topic, as well as an article on the site but the solutions offered there did not really fit me, so I did my own. I post it here in case anyone needs it.

1. Open FirefoxPortable\Data\settings\FirefoxPortableSettings.ini, change

LastProfileDirectory=NONE

then save it, and set ReadOnly attribute to this file.

2. Create FirefoxPortable\FirefoxPortable.global with the following content

[FirefoxPortable]
AllowMultipleInstances=true
DisableIntelligentStart=false

3. Create FirefoxPortable\load_profile.cmd with the following content

@echo off
@setlocal

if "%~1"=="" exit /b 2

set "profiles_path=Data"
set "lock_file=parent.lock"

for /f "usebackq tokens=* delims=" %%a in ('%~f0\..') do set "app_name=%%~na"

set "profile_name=%~1"
set "profile_path=%profiles_path%\%profile_name%"
set "profile_fullpath=%~dp0\%profile_path%"

if NOT "%profile_name:~0,2%" == "__" goto :skip_reset
call :check_profile_lock "%profile_fullpath%"
if NOT %errorlevel% EQU 0 exit /b %errorlevel%
>nul 2>&1 rd /s /q "%profile_fullpath%"
set "base_profile_name="
for /f "usebackq tokens=1,* delims=_" %%a in ('%profile_name%') do set "base_profile_name=%%b"
if "%base_profile_name%"=="" goto :no_base
set "base_profile_name=_%base_profile_name%"
set "base_profile_fullpath=%~dp0\%profiles_path%\%base_profile_name%"
call :check_profile_lock "%base_profile_fullpath%"
if NOT %errorlevel% EQU 0 exit /b %errorlevel%
>nul 2>&1 xcopy "%base_profile_fullpath%" "%profile_fullpath%" /s /e /c /i /q /g /h /r /k /y
:no_base
:skip_reset

>nul 2>&1 copy /y "%~dp0\%app_name%.global" "%~dp0\%app_name%.ini"
set "append_to_cfg=>>"%~dp0\%app_name%.ini" echo"
%append_to_cfg%.
%append_to_cfg%.ProfileDirectory=%profile_path%

start "" "%~dp0\%app_name%.exe"
exit /b 0

:check_profile_lock
@setlocal
set "profile_lock_file=%~1\%lock_file%"
if not exist "%profile_lock_file%" exit /b 0
>nul 2>&1 del /f /q /a "%profile_lock_file%"
if exist "%profile_lock_file%" exit /b 1
exit /b 0

4. Now create FirefoxPortable\%_PROFILE_NAME_%.cmd files (or just directly run FirefoxPortable\load_profile.cmd %_PROFILE_NAME_%) containing

@call "%~dp0\load_profile.cmd" "%~n0"

Examples
_heavy.cmd (begins with "_") - will load FF with FirefoxPortable\Data\_heavy profile
__clean.cmd (begins with "__") - will load FF with FirefoxPortable\Data\__clean profile, profile will be DELETED before loading each time. If profile is currently used by FF, script will do nothing.
__test_heavy.cmd (begins with "__", "_base_profile" appended after name) - will load FF with FirefoxPortable\Data\__test_heavy profile, profile will be DELETED and cloned from _heavy profile before loading each time. If profile is currently used by FF, script will do nothing. If original "base" profile is currently used by FF, script will also do not run (but profile will be already cleaned).

Also you can use "load_profile.cmd _heavy", "load_profile.cmd __clean", "load_profile.cmd __test_heavy"

Profile name started with "_", because filename started with "_" are in the top of the list.

P.S. I hope this will be useful to someone.
P.P.S. sorry for the bad English. I'm Russian and I'm drunk (^_^) so the text is translated by Yandex.

John T. Haller
John T. Haller's picture
Offline
Last seen: 2 hours 31 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Easiest (and Supported) Way

The easiest way, and the way we support multiple profiles without needing multiple full installs of Firefox Portable, is with the Second Profile tool: https://portableapps.com/support/firefox_portable#second_profile

You can install multiple copies, rename them as you'd like in the PA.c Platform, and the platform will even keep the profile tool up to date in all copies as long as you follow the naming convention in the link.

Sometimes, the impossible can become possible, if you're awesome!

mnp.ksb
Offline
Last seen: 2 years 3 months ago
Joined: 2022-08-11 10:46
To run multiple instances with different profile at same time

Need to run Firefox with multiple instances with different profile at same time because my web based software is supporting only one user instance as a time (Operator or Supervisor), so, I am trying run both of them at same time, can any one help me?

Dominic Tey
Offline
Last seen: 2 weeks 4 days ago
Joined: 2021-11-18 05:39
Install Portable Firefox 2nd Profile, FirefoxPortable.ini

This is what I do for my own multiple Firefox profiles opened and used at the same time.

a) follow the instructions at https://portableapps.com/support/firefox_portable#second_profile

1. Install PortableApps.com platform.
2. Install Mozilla Firefox via the platform
3. Install Mozilla Firefox 2nd Profile via the platform

Your PortableApps folder should have

  • Documents
  • PortableApps
    • FirefoxPortable
    • FirefoxPortable2ndProfile
  • Start.exe

where the FirefoxPortable and FirefoxPortable2ndProfile is inside the PortableApps folder.

b) Add the following line to FirefoxPortable.ini in \PortableApps\FirefoxPortable2ndProfile\Data folder

AllowMultipleInstances=true

For example mine is
[FirefoxPortable]
FirefoxDirectory=..\..\FirefoxPortable\App\firefox
ProfileDirectory=profile
SettingsDirectory=settings
PluginsDirectory=plugins
AllowMultipleInstances=true

c) Copy the FirefoxPortable2ndProfile folder to as many instances you need

For example the folder structure for a 5 instances Firefox could be

  • Documents
  • PortableApps
    • FirefoxPortable
    • FirefoxPortable2ndProfile
    • FirefoxPortable3rdProfile
    • FirefoxPortable4thProfile
    • FirefoxPortable5thProfile
  • Start.exe

d) rename the "Mozilla Firefox, Portable Edition 2nd Profile" in the PortableApps.com Platform to suit your needs.

e) the first Mozilla Firefox is not multiple instance and I won't bother making it multiple instance-able. You can hide it from the menu if you like it neat.

sillylenny
Offline
Last seen: 1 year 4 months ago
Joined: 2023-07-02 15:48
Hello.

Hello.

I've been running two profiles in portable Firefox for years but by using a Firefox fork - Comodo IceDragon (also portable).
Now I've realized that IceDragon is way behind Firefox and is apparently abandonware - sites render differently, and sometimes features don't even work, like login on some sites.

I've tried to use the method you've described here but I've never used the PA platform (and don't plan to).
My normal FF Portable is located at D:\Browsers\FF
I've installed the 2nd Profile at D:\Browsers\FF2, but after clicking FirefoxPortable2ndProfile.exe I get an error:
Firefox, Portable Edition 2nd Profile cannot be started. You may wish to re-install to fix this issue.
(ERROR: D:\Browsers\FirefoxPortable\FirefoxPortable.exe could not be found)

Renaming "FF" folder to "FirefoxPortable" fixes the issue, however - I still can't launch another profile at the same time, getting the usual "Another instance of Firefox is already running", either if I launch the normal one first, or the 2nd Profile first.

Any way to fix this? Is PA platform necessary?

John T. Haller
John T. Haller's picture
Offline
Last seen: 2 hours 31 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Keep Standard Names, Set Advanced INI Option

You need to keep the standard folder names or it can't find it, which is why it can when you switch it back to FirefoxPortable instead of FF. To let multiple instances run at the same time, you can set the advanced INI option called AllowMultipleInstances. It's detailed in the readme.txt within FirefoxPortable\Other\Source. This readme is referenced and linked to in the help.html file in the FirefoxPortable base directory. For the FirefoxPortableSecondProfile instance, this FirefoxPortable.ini will be within the Data directory after it has been run once instead of in the root directory.

Note that I can't recall if you can run two instances of Firefox from the same install at the same time in the current version. If you can't, create a copy of your base FirefoxPortable directory and then rename it FirefoxPortable_Copy_1 or similar. Then set the advanced INI option in both.

Sometimes, the impossible can become possible, if you're awesome!

sillylenny
Offline
Last seen: 1 year 4 months ago
Joined: 2023-07-02 15:48
Setting

Setting AllowMultipleInstances=true for both instances and renaming folders(?) didn't help.

John T. Haller
John T. Haller's picture
Offline
Last seen: 2 hours 31 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Not Second Instance

I meant you may need two full copies of Firefox Portable to be able to run them side by side.

Sometimes, the impossible can become possible, if you're awesome!

sillylenny
Offline
Last seen: 1 year 4 months ago
Joined: 2023-07-02 15:48
Nope, same old error, it's

Nope, same old error, it's like AllowMultipleInstances means nothing.

John T. Haller
John T. Haller's picture
Offline
Last seen: 2 hours 31 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Placement

Did you copy the FirefoxPortable.ini to the FirefoxPortable directory?

Sometimes, the impossible can become possible, if you're awesome!

sillylenny
Offline
Last seen: 1 year 4 months ago
Joined: 2023-07-02 15:48
I did now, it worked. I'm

I did now, it worked. I'm sorry, I really couldn't recognize this step from your previous message.
Thank you.

Log in or register to post comments