Jump to content

Thunderbird and FireFox Configuration Script


ashleysmith55
 Share

Recommended Posts

I’m trying to rollout FireFox and Thunderbird. I have created a simple batch file script (source code below) to install firefox 1.5.0.6 and Thunderbird 1.5.0.5.

@Echo off

COLOR 1f

MODE CON COLS=40 LINES=5

TITLE FireFox and Thunderbird

Echo Installing Thunderbird 1.5.0.4

Echo Please wait...

start /wait k:\software\mozilla\Thunderbird1.5.0.5.exe /ms

Echo.

Echo.

cls

Echo Installing Firefox 1.5.0.5

Echo Please wait...

start /wait k:\software\mozilla\firefox1.5.0.6.exe /ms

Echo.

Echo.

Exit

The script works fine, but when I launch Firefox or Thunderbird, the configuration wizard pops up. I know that the configuration file is “prefs.js”, but how can I configure this in a script for each different user?

The email server and settings will be the same, but the user name is different. Ideally somebody will know of a script that will produce a popup box saying, “Enter your username” then it will configure FireFox and Thunderbird for him or her.

Any ideas?

All help welcome….

Ashley

Link to comment
Share on other sites

  • 2 weeks later...

If anyone is interested, I wrote a script that answers my own question. It's below (called config.cmd):

@echo off

COLOR 1f

MODE CON COLS=50 LINES=5

TITLE Thunderbird Configuration Utility

ECHO Configuring Thunderbird

ECHO Please wait...

:: First test to see if we are on NT or similar OS

:: The ony difference is how they handle the ampersand

> ~userin.vbs echo 1234&rem

type ~userin.vbs | find "rem" > nul

if errorlevel 1 goto LOGNAME

goto WIN9X

:WIN9X

call error.vbs

:LOGNAME

> ~userin.vbs echo strUserIn = InputBox("Please enter your login name")

>> ~userin.vbs echo Set fs = CreateObject("Scripting.FileSystemObject")

>> ~userin.vbs echo strFileName = fs.BuildPath(Wscript.ScriptFullName ^& "\..", "~userin.bat")

>> ~userin.vbs echo strFileName = fs.GetAbsolutePathName(strFileName)

>> ~userin.vbs echo Set ts = fs.OpenTextFile(strFileName, 2, True)

>> ~userin.vbs echo ts.WriteLine "set userin=" ^& strUserIn

>> ~userin.vbs echo ts.Close

goto RUN

:RUN

:: Now run the created script

start /w wscript.exe ~userin.vbs

del ~userin.vbs

:: Now call the created batch file

call ~userin.bat

del ~userin.bat

:: Now display the data!

::echo You entered %USERIN%

::pause

::cls

::Now output %USERIN% to prefs.js

K:\software\WindowsXP\Thunderbird\change.com prefs.js "UID" "%USERIN%" > NUL

goto EMAIL

:EMAIL

> ~email.vbs echo strUserIn = InputBox("Please enter your FULL email address")

>> ~email.vbs echo Set fs = CreateObject("Scripting.FileSystemObject")

>> ~email.vbs echo strFileName = fs.BuildPath(Wscript.ScriptFullName ^& "\..", "~email.bat")

>> ~email.vbs echo strFileName = fs.GetAbsolutePathName(strFileName)

>> ~email.vbs echo Set ts = fs.OpenTextFile(strFileName, 2, True)

>> ~email.vbs echo ts.WriteLine "set email=" ^& strUserIn

>> ~email.vbs echo ts.Close

goto RUN2

:RUN2

:: Now run the second created script

start /w wscript.exe ~email.vbs

del ~email.vbs

:: Now call the created batch file

call ~email.bat

del ~email.bat

:: Now display the data!

::echo You entered %EMAIL%

::pause

::cls

::Now output %EMAIL% to prefs.js

K:\software\WindowsXP\Thunderbird\change.com prefs.js "EID" "%EMAIL%" > NUL

:NAME

> ~name.vbs echo strUserIn = InputBox("Please enter your First name and Surname")

>> ~name.vbs echo Set fs = CreateObject("Scripting.FileSystemObject")

>> ~name.vbs echo strFileName = fs.BuildPath(Wscript.ScriptFullName ^& "\..", "~name.bat")

>> ~name.vbs echo strFileName = fs.GetAbsolutePathName(strFileName)

>> ~name.vbs echo Set ts = fs.OpenTextFile(strFileName, 2, True)

>> ~name.vbs echo ts.WriteLine "set name=" ^& strUserIn

>> ~name.vbs echo ts.Close

goto RUN3

:RUN3

:: Now run the second created script

start /w wscript.exe ~name.vbs

del ~name.vbs

:: Now call the created batch file

call ~name.bat

del ~name.bat

:: Now display the data!

::echo You entered %name%

::pause

::cls

::Now output %NAME% to prefs.js

K:\software\WindowsXP\Thunderbird\change.com prefs.js "NID" "%NAME%" > NUL

call message.vbs

xcopy "k:\Software\WindowsXP\Thunderbird\Thunderbird\*.*" "%appdata%\Thunderbird\" /e /y /q

xcopy "k:\Software\WindowsXP\Thunderbird\prefs.js" "%appdata%\Thunderbird\Profiles\adh18umt.default\" /y /q

xcopy "k:\Software\WindowsXP\Thunderbird\template\prefs.js" "k:\Software\WindowsXP\Thunderbird\prefs.js" /y /q

Exit

Error.vbs looks like this:

MsgBox "This script is not designed for your Operating System.", vb, "Company Name"

Message.vbs looks like this:

MsgBox "Please check that prefs.js has been successfully modified.", vb, "Company Name"

Create a sample prefs.js to work with and download change.com..... Job done

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.


×
×
  • Create New...