It is currently Fri May 24, 2013 7:07 pm

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Settings backup tool
PostPosted: Fri Nov 16, 2007 12:03 pm 
Senior Member
User avatar

Joined: Sat Aug 07, 2004 12:24 pm
Posts: 2223
Location: Western NY, USA
For moving to a new computer or doing system refreshes, this helps to save and restore the Weather Watcher settings. At least on my Windows XP SP2 system.

WWBackup.cmd
Code:
@echo off&title Weather Watcher settings backup&mode CON Lines=18 Cols=77
:: Modified version of the COMODO 2.4 firewall backup script
set BKUPfolder=%SYSTEMDRIVE%\Documents and Settings\%USERNAME%\DESKTOP\WWBackup\

set REGkey=HKEY_CURRENT_USER\Software\VB and VBA Program Settings\Weather Watcher
set BKUPfile=WWsettings.REG

if not "%1" == "" set BKUPfolder=%1
if not "%2" == "" set BKUPfolder=%1 %2
if not "%3" == "" set BKUPfolder=%1 %2 %3

cls
echo.
echo ***************************************************
echo  The Weather Watcher settings will be backed up to:
echo    "%BKUPfolder%%BKUPfile%"
if exist "%BKUPfolder%%BKUPfile%" for %%i in ("%BKUPfolder%%BKUPfile%") do
echo    Date/time of last backup: %%~ti
echo.
echo  To Restore the "%BKUPfile%" file's settings back into the Registry:
echo    1. Shutdown Weather Watcher
echo    2. Open RegEdit and delete the key
echo       HKEY_CURRENT_USER\Software\VB and VBA Program Settings\Weather Watcher
echo    3. Close RegEdit
echo    4. Finally dbl click on the backup .reg file.
echo.
echo  NOTE: You may also need to reboot the PC!
echo ***************************************************
echo.
echo To start press Enter. To quit press the "x" button on this window
pause >nul

cls
if not exist "%BKUPfolder%%BKUPfile%" goto :new
goto :archive

:archive
echo Clearing oldest backup - please wait ..
del "%BKUPfolder%Prior\%BKUPfile%" >nul
echo Storing previous backup - please wait ...
copy "%BKUPfolder%%BKUPfile%" "%BKUPfolder%Prior\%BKUPfile%" > nul
echo Archiving current rule set - please wait ....
REGEDIT /E "%BKUPfolder%%BKUPfile%" "%REGkey%"
goto :end

:new
cls
echo.
echo Creating folders - please wait ...
echo.
md "%BKUPfolder%"
md "%BKUPfolder%Prior"
echo Archiving registry keys - please wait ...
REGEDIT /E "%BKUPfolder%%BKUPfile%" "%REGkey%"
copy "%BKUPfolder%%BKUPfile%" "%BKUPfolder%Prior\%BKUPfile%" >nul
goto :end

:end
echo.
echo DONE!!!
echo.
echo Press any key to end
pause >nul

When cutting&pasting be careful of line wrapping of the CMD lines. The set REGkey in particular. It's all one line.

hth

BTW The Backup file could be smaller if the WW Registry key could be structured differently. A subkey for all the Setting keys and a subkey for all Forecasts data keys would allow the Forecasts data fields to be excluded. Since they are created each time WW does a Retrieval there is no real need to back them up.

NB When copying and pasting the above script be sure there is no extra space or blank at the end of the three set commands at the top of the script in the version you save. Either Windows or the board's forum sw is adding it in some cases which results in the script failing. :sad:

Update: Revised the script's Restore steps.


Last edited by Ed_P on Wed Apr 30, 2008 10:44 pm, edited 5 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 20, 2007 3:12 am 

Joined: Thu Aug 11, 2005 6:48 pm
Posts: 217
Location: 3rd Rock
Thanks for that Ed. I'll verify this in Vista when I get my computer back up and running.


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 03, 2008 11:25 am 
Senior Member
User avatar

Joined: Sat Aug 07, 2004 12:24 pm
Posts: 2223
Location: Western NY, USA
New version, excludes most weather data from the backup file. (The Current data was not excluded because it is used by the WW Tooltip.)

WWBackup.cmd
Code:
@echo off&title Weather Watcher settings backup&mode CON Lines=18 Cols=77
:: Modified version of the COMODO 2.4 firewall backup script

set BKUPfolder=%SYSTEMDRIVE%\Documents and Settings\%USERNAME%\DESKTOP\WWBackup\
set REGkey=HKEY_CURRENT_USER\Software\VB and VBA Program Settings\Weather Watcher
set BKUPfile=WWsettings.REG
::set BKUPfolder=D:\My Documents\WWtest\

if not "%1" == "" set BKUPfolder=%1
if not "%2" == "" set BKUPfolder=%1 %2
if not "%3" == "" set BKUPfolder=%1 %2 %3

cls
echo ***************************************************
echo  The Weather Watcher settings will be backed up to:
echo    "%BKUPfolder%%BKUPfile%"
if exist "%BKUPfolder%%BKUPfile%" for %%i in ("%BKUPfolder%%BKUPfile%") do  echo    Date/time of last backup: %%~ti
echo.
echo  To Restore the "%BKUPfile%" file's settings back into the Registry:
echo    1. Shutdown Weather Watcher
echo    2. Open RegEdit and delete the key
echo       HKEY_CURRENT_USER\Software\VB and VBA Program Settings\Weather Watcher
echo    3. Close RegEdit
echo    4. Finally dbl click on the backup .reg file.
echo.
echo  NOTE: You may also need to reboot the PC!
echo ***************************************************
echo.
echo To start press Enter. To quit click on the window's "X" button.
pause >nul

cls
if not exist "%BKUPfolder%%BKUPfile%" goto :new

:update
echo.
echo Clearing oldest backup - please wait ..
del "%BKUPfolder%Prior\%BKUPfile%" > nul
echo Saving previous backup - please wait ...
copy "%BKUPfolder%%BKUPfile%" "%BKUPfolder%Prior\%BKUPfile%" > nul
goto archive

:new
cls
echo.
echo Creating folders - please wait ...
echo.
md "%BKUPfolder%"
md "%BKUPfolder%Prior"

:archive
echo Archiving registry keys - please wait ....

if exist "%BKUPfolder%\WWDelData.REG"    del "%BKUPfolder%\WWDelData.REG"
echo Windows Registry Editor Version 5.00  > "%BKUPfolder%\WWDelData.REG"
echo [-%REGkey%\Daily]                    >> "%BKUPfolder%\WWDelData.REG"
echo [-%REGkey%\Detailed]                 >> "%BKUPfolder%\WWDelData.REG"
echo [-%REGkey%\Hourly]                   >> "%BKUPfolder%\WWDelData.REG"
START /WAIT REGEDIT  /S                      "%BKUPfolder%\WWDelData.REG"

REGEDIT /E "%BKUPfolder%%BKUPfile%" "%REGkey%"

if not exist "%BKUPfolder%Prior\%BKUPfile%" copy "%BKUPfolder%%BKUPfile%" "%BKUPfolder%Prior\%BKUPfile%" > nul

:end
echo.
echo DONE!!!
echo.
echo Press any key to end
pause >nul


When cutting & pasting be careful of line wrapping of the CMD lines. The set REGkey in particular. It's all one line.

Also when copying and pasting the above script be sure there is no extra space or blank at the end of the three set commands at the top of the script in the version you save. Either Windows or the board's forum sw is adding it in some cases which results in the script failing.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group