Fix the name of the Thunderbird roaming folder by a script

465 views Asked by At

I need to fix the the name of the Users Thunderbird profile folder located in C:\Users\%USERNAME%\AppData\Roaming\Thunderbird.

To do this, I've made a batch script wich changes the xxxxx.default created at the Thunderbird first launch in :

The profiles.ini file
The path of the roaming folder (see below)
All occurrences in prefs.js file
The name of the "Local profile" folder

But even with this, Thunderbird creates another xxxxx.default folder when I start it after running my script. My question is : why ? What missed I ? Is there another location where I must change the xxxxx.default ? Thanks

1

There are 1 answers

0
nicolasfo On

Auto answer : I had to change the name of the folder located in C:\Users\%USERNAME%\AppData\Roaming\Thunderbird by a name of my choice (mv command).
Then, I created a new profile.ini file with this folder path (echo to a file command). All the rest (prefs.js for example) is made automatically by Thunderbird on the first startup.

1 step : Identify the name of the random directory using DIR command and store it into a variable :

DIR "C:\Users\%USERNAME%\AppData\Roaming\Thunderbird\Profiles" /ad /b > temp.txt
SET /p PROFIL_FOLDER= < temp.txt

2 step : Change the random folder name :

MV "C:\Users\%USERNAME%\AppData\Roaming\Thunderbird\Profiles\%PROFILE_FOLDER%" "C:\Users\%USERNAME%\AppData\Roaming\Thunderbird\Profiles\NEW_DIR"

3 step : Write a new profiles.ini file :

INI_FILE="C:\Users\%USERNAME%\AppData\Roaming\Thunderbird\Profiles.ini
ECHO [General]>%INI_FILE%
ECHO StartWithLastProfile=^1>>%INI_FILE%
ECHO [Profile0]>>%INI_FILE%
ECHO Name=default>>%INI_FILE%
ECHO IsRelative=^0>>%INI_FILE%
ECHO Path=C:\Users\%USERNAME%\AppData\Roaming\Thunderbird\Profiles\NEW_DIR>>%INI_FILE%
ECHO Default=^1>>%INI_FILE%

All of these is to put in a batch file wich is launched at the startup session.