Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7635377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:24:47+00:00 2026-05-31T07:24:47+00:00

I have only very basic skills writing batch files for windows. I’d like to

  • 0

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.js where %APPDATA%\Thunderbird\Profiles\*.default is zero, one or more profile folders when the wildcard is expanded
  • findstr can be used to search a file
  • I know about the echo command 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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T07:24:48+00:00Added an answer on May 31, 2026 at 7:24 am

    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:

    for /d %%x in ("%APPDATA%\Thunderbird\Profiles\*.default") do (
      findstr /v /c:"msgcompose.text_color" "%%x\prefs.js" > "%%x\prefs.new.js"
      echo user_pref^("msgcompose.text_color", "black"^);>>"%%x\prefs.new.js"
      move /y "%%x\prefs.new.js" "%%x\prefs.js" >nul
    )
    

    findstr /v only prints lines that don’t include the searched text.

    During testing I’d advise to comment out the move in the last line until you’re sure that it in fact works correctly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I only have very basic knowledge on Javascript and I want to be able
I have a very basic question on usage of resource files (like XML etc.)
I have very little programming knowledge; only a fair bit in Visual Basic. How
I have only one table in my mySql database for a very basic website
I'm making some frontend experiments and I'd like to have a very basic webserver
very simple basic question I have only route: routes.MapRoute( Widget, // Route name Widget/Frame/{postUrl},
Okay. This is propably very basic and noobie, but I have about 20+ stores
I have a database to store people's quick links. This is a very basic
I know this is a very basic concept in Django, and I have tried
I realize that this is probably a very basic question, but I have spent

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.