Jump to content

program (or batch) to backup profiles


fillalph

Recommended Posts

At the moment I am backing up my firefox and thunderbird profiles manually into a WinRAR SFX and then having it extracted during install.

I know there are members on this forum that do use firefox and thunderbird, I was thinking of a good way to backup the profiles easily. the easiest way would probably be a batch.

I took a look at the capabilities of rar.exe and noticed that you it can read in a comment file using the command line.

My idea is this:

The profiles are located in: %APPDATA%\\Thunderbird\*default\ and \Mozilla\Firefox\Profiles\*default (assuming we only want to backup the default profile).

So if we change into that direct and store it as a variable and pass that along to rar.exe, we could archive into a sfx with a prewritten comment file. Once we have the backed up profiles move them over to replace the old ones on our UA cds/dvds. Then before every new UA version, we just run the batch file and presto, firefox and thunderbird profiles (bookmarks, extensions, mail, imap settings, etc.) all backed up.

I suck at writing batch files. I am going to try, but if you want to beat me to it, I won't be sad :).

]Bonkers[

Link to comment
Share on other sites


Alright. I got it working.

EDIT!!! I split firefox and thunderbird into two files to update!

The command file (firefox_backup.cmd)

ECHO OFF
ECHO Backing up Firefox Profile
set rar="%PROGRAMFILES%\WinRAR\RAR.exe"
set temp=%CD%
IF EXIST firefox_profile.exe del %CD%\firefox_profile.bak
IF EXIST firefox_profile.exe rename %CD%\firefox_profile.exe firefox_profile.bak
C:
cd "%APPDATA%\Mozilla\Firefox\Profiles\*default"
set firefox_dir=%CD%
del /f /q "%firefox_dir%\cookies.txt"
del /f /q "%firefox_dir%\Cache\*"
%rar% a -z"%temp%\c_firefox.txt" -r -sfx firefox_profile
move "%firefox_dir%\firefox_profile.exe" "%temp%"
EXIT

The command file (thunderbird_backup.cmd)

ECHO OFF
ECHO Backing up thunderbird Profile
set rar="%PROGRAMFILES%\WinRAR\RAR.exe"
set temp=%CD%
IF EXIST thunderbird_profile.exe del %CD%\thunderbird_profile.bak
IF EXIST thunderbird_profile.exe rename %CD%\thunderbird_profile.exe thunderbird_profile.bak
C:
cd "%APPDATA%\Thunderbird\*default"
set thunderbird_dir=%CD%
%rar% a -z"%temp%\c_thunderbird.txt" -r -sfx thunderbird_profile
move "%thunderbird_dir%\thunderbird_profile.exe" "%temp%"
EXIT

now you also need 2 text files that have your comments:

c_thunderbird.txt

;The comment below contains SFX script commands

Path=%PROGRAMFILES%\Mozilla Thunderbird\defaults\profile
SavePath
Silent=1
Overwrite=1

and

c_firefox.txt

;The comment below contains SFX script commands

Path=%PROGRAMFILES%\Mozilla Firefox\defaults\profile
SavePath
Silent=1
Overwrite=1

These two batches reside in the same folder as my firefox and thunderbird folders. I just run them right before making my new cd and I have updated profiles for both.

Enjioy :)

]Bonkers[

Edited by ]Bonkers[
Link to comment
Share on other sites

for bad english:

Great...

This is mine...

CLS
@ECHO OFF
COLOR 70
MODE CON COLS=44 LINES=14
set rar="%temp%\WinRAR\RAR.exe"
cd "%APPDATA%\Mozilla\Firefox\Profiles\*default"
set fxprofile_dir=%CD%
del /f /q "%fxprofile_dir%\cookies.txt"
del /f /q "%fxprofile_dir%\cookies-*.txt"
del /f /q "%fxprofile_dir%\Cache\*"
cd "%APPDATA%\Mozilla\Firefox\Profiles"
set firefox_dir=%CD%
%rar% a -k -z"%temp%\c_firefox.txt" -r -sfx BackupFirefox
move "%firefox_dir%\BackupFirefox.exe" "%SystemDrive%\"
RD /S /Q %Temp%\WinRAR
del /S /Q "%temp%\c_firefox.txt"
cls
ECHO ------------------------------------------
ECHO Mozilla Firefox Profile Backup Program
ECHO ------------------------------------------
ECHO.
ECHO * Backuping Firefox profile...
ECHO * Delete Cookies & Cache ...
ECHO * Compressing profile...
ECHO * Moving backup file to C:...
ECHO.
ECHO * Profile backup complete...
ECHO.
ECHO. Powed by anick
ECHO ------------------------------------------
pause
EXIT

see here :)

Edited by anick
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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...