It is currently Tue May 21, 2013 1:59 pm

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 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 1 guest


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