I have only very basic skills writing batch files for windows.
I’d like to be able to add this line to prefs.js for every ThunderBird Profile as part of a login script:
user_pref("msgcompose.text_color", "black");
If msgcompose.text_color it is there already with some other value, ideally I want it replaced with "black".
I have some of the pieces of the puzzle:
- the files can be found at:
%APPDATA%\Thunderbird\Profiles\*.default\prefs.jswhere%APPDATA%\Thunderbird\Profiles\*.defaultis zero, one or more profile folders when the wildcard is expanded - findstr can be used to search a file
- I know about the
echocommand and>>
How do I put these pieces together?
EDIT:
although this method works, I’ve since discovered user.js which is a better method of overriding settings in prefs.js
The easiest way I can see is to first remove the pref if it’s already there and unconditionally appent it to the file. That way you wouldn’t do an overwrite if it is already present, but that’s much harder to do in a plain batch file.
Something like that:
findstr /vonly prints lines that don’t include the searched text.During testing I’d advise to comment out the
movein the last line until you’re sure that it in fact works correctly.