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.cmdCode:
@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.