2008-12-29

Setting the default profile in Firefox and Thundebird

Firefox and Thunderbird (fine browser and email client products from Mozilla) allow you to have different profiles, such that Firefox or Thunderbird may be started up with different settings, different email account settings, different bookmarks, etc...

You'll normally have one profile only, and unless you renamed it, it is called "default".
In order to create additional profiles, run the software from the command line:

firefox.exe -P
or
thunderbird.exe -P
A window pops up to create new profiles, or you can choose which profile to start the application with:
Once several profiles exist, simply running "firefox.exe" or "thunderbird.exe" will make use of the default profile (whichever that is; this is the problem). It is possible to start with a specific profile, by running one of the following:
firefox.exe -P "UserA"
firefox.exe -P "UserB"
where UserA and UserB are the names of your profiles in Firefox (it's the same for Thunderbird).

I ran into a problem which I did not find documentation for, and this is why I write this. Which of those is the default profile? The profile selection dialog window shown above does not make it possible to set the default profile among the list of available ones.

While it is possible to use the profile selection window to choose a profile every time you run Firefox/Thunderbird, there are some problems if the default profile is not the one you expect. For example, in Windows XP/Vista, a context menu item named "Sent to mail recipient" will open a Thunderbird window to write an e-mail, but it will use the default Thunderbird profile. Clicking on "mailto:" links on webpages will also prompt Windows Vista/XP to execute Thunderbird, using its default profile. For these reasons, you may want to choose which is your default Thunderbird profile.

Setting the default profile
It turns out it is very easy:
  1. Make sure all Thunderbird windows are closed
  2. Locate the profiles.ini file for your user (in Vista this is normally "C:\Users\UserName\AppData\Roaming\Thunderbird", and in XP "C:\Documents and Settings\UserName\Application Data\Thunderbird", or similar. More info on this: http://kb.mozillazine.org/Profile_folder_-_Thunderbird
  3. Edit the file profiles.ini, and add the line "Default=1" only to the profile you want to make your default.
Here's an example profiles.ini file indicating the default profile:
[General]
StartWithLastProfile=1

[Profile0]
Name=default
IsRelative=1
Path=Profiles/6y2nagku.default

[Profile1]
Name=John
IsRelative=1
Path=Profiles/8dje3h37.John
Default=1

References:
http://kb.mozillazine.org/Profile_folder_-_Thunderbird
https://developer.mozilla.org/En/Command_Line_Options

2008-12-27

Move the "Users" folder (user profiles) to a different location in Vista

In Windows Vista you've got the possibility to specify, right from the Vista interface, the location of each folder in a user profile. For example, it's easy to indicate that you want to have "Downloads" in a different drive (for detailed instructions on how to do this you can follow the official MS advice).

However, if what you want to do is move the entire C:\Users folder structure and have the OS recognize that change without going nuts, there's an elegant solution that we found after googling for a while. While you can read about it in the original articles (here and here), it all boils down to this (but please, do have a look at the original articles since the explanations of what is going on are really helpful) (and please, please, please: if you want to be sure that you don't loose anything... backup first!):

  1. Create the new "Users" folder wherever you want it to be (e.g., E:\Users)
  2. Boot off the Vista install DVD and choose to Repair from the introductory window. Choose the target Vista installation and then bring up a command prompt (note: in some computers you don't need the Vista DVD, there's an option to boot the computer into some System Recovery options and from there you have access to a console).
  3. Once you are in a command prompt, copy all the data from your original C:\Users to the target E:\Users. To do this, you must use a command that copies all the data, links, folders, etc. I have used Robocopy and it works very well. The command that I used is:
    robocopy C:\Users E:\Users /E /COPYALL /XJ
  4. Now that you have all your data copied... delete the original C:\Users folder! Yes! Have no fear! But please, make sure first that your data is now safely copied in E:\Users. Please note that after deleting C:\Users you can still go back by copying the data to C:\Users from E:\Users... but that's not what you want to do, is it? In any case, use the following command to delete C:\Users:
    rmdir /S /Q C:\Users

  5. After deleting C:\Users, delete also C:\Documents and Settings (it's just a link to C:\Users):
    rmdir "C:\Documents and Settings"
  6. Now we have to create the link that will tell Vista that when it looks for C:\Users, it has to go to E:\Users. Use this command:
    mklink /J C:\Users E:\Users
  7. We recreate as well the link from Documents and Settings:
    mklink /J "C:\Documents and Settings" E:\Users
  8. Restart! Everything should be in place, we should be able to log on with our user accounts, etc.
I have followed this procedure already twice and have had no problems at all. Everything's working fine, Vista puts all the data in E:\Users and all is well. Note that if you go in Windows Explorer to C:\Users, you will see it there, and you can navigate its contents, but remember that the data is physically stored in the E:\ partition, not in C:\Users.

I recommend you reading the articles that I found originally, since there is some discussion in them that might be helpful to you.

You can use this same procedure to modify the location of C:\Program Files, for example. I have not tried to do this, but I guess it should be problem-free. Still, as with changing the Users folder, proceed at your own risk!

Have a nice day!
Marcelo