Settings backup tool

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
[/code]
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.

Thanks for that Ed. I’ll verify this in Vista when I get my computer back up and running.

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[/code]

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.