ashleysmith55 Posted August 22, 2006 Posted August 22, 2006 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 offCOLOR 1fMODE CON COLS=40 LINES=5TITLE FireFox and ThunderbirdEcho Installing Thunderbird 1.5.0.4Echo Please wait...start /wait k:\software\mozilla\Thunderbird1.5.0.5.exe /msEcho.Echo.clsEcho Installing Firefox 1.5.0.5Echo Please wait...start /wait k:\software\mozilla\firefox1.5.0.6.exe /msEcho.Echo.ExitThe 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
ashleysmith55 Posted September 6, 2006 Author Posted September 6, 2006 If anyone is interested, I wrote a script that answers my own question. It's below (called config.cmd):@echo offCOLOR 1fMODE CON COLS=50 LINES=5TITLE Thunderbird Configuration UtilityECHO Configuring ThunderbirdECHO 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&remtype ~userin.vbs | find "rem" > nulif errorlevel 1 goto LOGNAMEgoto WIN9X:WIN9Xcall 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.Closegoto RUN:RUN:: Now run the created scriptstart /w wscript.exe ~userin.vbsdel ~userin.vbs:: Now call the created batch filecall ~userin.batdel ~userin.bat:: Now display the data!::echo You entered %USERIN%::pause::cls ::Now output %USERIN% to prefs.jsK:\software\WindowsXP\Thunderbird\change.com prefs.js "UID" "%USERIN%" > NULgoto 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.Closegoto RUN2:RUN2:: Now run the second created scriptstart /w wscript.exe ~email.vbsdel ~email.vbs:: Now call the created batch filecall ~email.batdel ~email.bat:: Now display the data!::echo You entered %EMAIL%::pause::cls ::Now output %EMAIL% to prefs.jsK:\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.Closegoto RUN3:RUN3:: Now run the second created scriptstart /w wscript.exe ~name.vbsdel ~name.vbs:: Now call the created batch filecall ~name.batdel ~name.bat:: Now display the data!::echo You entered %name%::pause::cls ::Now output %NAME% to prefs.jsK:\software\WindowsXP\Thunderbird\change.com prefs.js "NID" "%NAME%" > NULcall message.vbsxcopy "k:\Software\WindowsXP\Thunderbird\Thunderbird\*.*" "%appdata%\Thunderbird\" /e /y /qxcopy "k:\Software\WindowsXP\Thunderbird\prefs.js" "%appdata%\Thunderbird\Profiles\adh18umt.default\" /y /qxcopy "k:\Software\WindowsXP\Thunderbird\template\prefs.js" "k:\Software\WindowsXP\Thunderbird\prefs.js" /y /qExitError.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
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now