Script to backup CFP V3 Alpha settings

G’day,

Attached is a script for backing up the rulesets and configuration for CFPV3. It is based on V1.5 of Rottys CFP backup script.

The code for the CFPV3 script is as follows


[i] [ at ] echo off
cls
echo *****************************
echo The settings are backed up to %SYSTEMDRIVE%\Documents and Settings%USERNAME%\DESKTOP\CFP3Backup\CFPRUles.REG
echo Merge the “CFPrules.reg” file back, to restore settings
echo *****************************
echo To start press enter. To quit press the “x” button on this window
pause >nul:

cls
if not exist “%SYSTEMDRIVE%\Documents and Settings%USERNAME%\DESKTOP\CFP3Backup” goto :new
goto :archive

:archive
echo Clearing oldest backup - please wait
del “%SYSTEMDRIVE%\Documents and Settings%USERNAME%\DESKTOP\CFP3Backup\Prior\CFPRUles.REG” >nul:
echo Storing previous backup - please wait …
copy “%SYSTEMDRIVE%\Documents and Settings%USERNAME%\DESKTOP\CFP3Backup\CFPRUles.REG” “%SYSTEMDRIVE%\Documents and Settings%USERNAME%\DESKTOP\CFP3Backup\Prior\CFPRUles.REG”
echo Archiving current rule set - please wait …
REGEDIT /E “%SYSTEMDRIVE%\Documents and Settings%USERNAME%\DESKTOP\CFP3Backup\CPFRUles.REG” “HKEY_LOCAL_MACHINE\SYSTEM\Software\Comodo\Firewall Pro”
goto :end

:new
cls
echo.
echo Creating folders - please wait …
echo.
md “%SYSTEMDRIVE%\Documents and Settings%USERNAME%\DESKTOP\CFP3Backup”
md “%SYSTEMDRIVE%\Documents and Settings%USERNAME%\DESKTOP\CFP3Backup\Prior”
echo Archiving registry keys - please wait …
REGEDIT /E “%SYSTEMDRIVE%\Documents and Settings%USERNAME%\DESKTOP\CFP3Backup\CPFRUles.REG” “HKEY_LOCAL_MACHINE\SYSTEM\Software\Comodo\Firewall Pro”
copy “%SYSTEMDRIVE%\Documents and Settings%USERNAME%\DESKTOP\CFP3Backup\CFPRUles.REG” “%SYSTEMDRIVE%\Documents and Settings%USERNAME%\DESKTOP\CFP3Backup\Prior\CFPRUles.REG” >nul:
goto :end

:end
echo DONE!!!
echo Press any key to end
pause >nul:[/i]


Hope this helps,
Ewen :slight_smile:

EDIT : minor mod to code. modified script attached

[attachment deleted by admin]

   Hi Panic, thank you for the script. But, shouldn't the line of code in the creating folder area:

md “%SYSTEMDRIVE%\Documents and Settings%USERNAME%\DESKTOP\CPFBackup”

   actually be:

md “%SYSTEMDRIVE%\Documents and Settings%USERNAME%\DESKTOP\CPF3Backup”

…thanks again…

Thanks for that - fat fingers strike again! :slight_smile:

I’ve modified the sample code and the attached script file accordingly. I’ve also changed “CPF” to “CFP” fopr cerrectness.

Thanks again,
Ewen :slight_smile:

G’day,

Attached is a script for backing up the rulesets and configuration for CFPV3. It is based on V1.5 of Rottys CFP backup script.

The code for the CFPV3 script is as follows


[i] [ at ] echo off
cls
echo *****************************
echo The settings are backed up to %SYSTEMDRIVE%\Documents and Settings%USERNAME%\DESKTOP\CFP3Backup\CFPRUles.REG
echo Merge the “CFPrules.reg” file back, to restore settings
echo *****************************
echo To start press enter. To quit press the “x” button on this window
pause >nul:

cls
if not exist “%SYSTEMDRIVE%\Documents and Settings%USERNAME%\DESKTOP\CFP3Backup” goto :new
goto :archive

:archive
echo Clearing oldest backup - please wait
del “%SYSTEMDRIVE%\Documents and Settings%USERNAME%\DESKTOP\CFP3Backup\Prior\CFPRUles.REG” >nul:
echo Storing previous backup - please wait …
copy “%SYSTEMDRIVE%\Documents and Settings%USERNAME%\DESKTOP\CFP3Backup\CFPRUles.REG” “%SYSTEMDRIVE%\Documents and Settings%USERNAME%\DESKTOP\CFP3Backup\Prior\CFPRUles.REG”
echo Archiving current rule set - please wait …
REGEDIT /E “%SYSTEMDRIVE%\Documents and Settings%USERNAME%\DESKTOP\CFP3Backup\CPFRUles.REG” “HKEY_LOCAL_MACHINE\SYSTEM\Software\Comodo\Firewall Pro”
goto :end

:new
cls
echo.
echo Creating folders - please wait …
echo.
md “%SYSTEMDRIVE%\Documents and Settings%USERNAME%\DESKTOP\CFP3Backup”
md “%SYSTEMDRIVE%\Documents and Settings%USERNAME%\DESKTOP\CFP3Backup\Prior”
echo Archiving registry keys - please wait …
REGEDIT /E “%SYSTEMDRIVE%\Documents and Settings%USERNAME%\DESKTOP\CFP3Backup\CPFRUles.REG” “HKEY_LOCAL_MACHINE\SYSTEM\Software\Comodo\Firewall Pro”
copy “%SYSTEMDRIVE%\Documents and Settings%USERNAME%\DESKTOP\CFP3Backup\CFPRUles.REG” “%SYSTEMDRIVE%\Documents and Settings%USERNAME%\DESKTOP\CFP3Backup\Prior\CFPRUles.REG” >nul:
goto :end

:end
echo DONE!!!
echo Press any key to end
pause >nul:[/i]


Hope this helps,
Ewen :slight_smile:

EDIT : minor mod to code. modified script attached

[attachment deleted by admin]

Hi again, panic
The new script backed up the settings OK, but does not archive to the Prior directory. I found 2 references to CPFRUles.REG that should be changed to CFPRUles.REG…per your mod to the code.

1st in : Archiving current rule set
2nd in : Archiving registry keys

  I guess this happened when you changed the CPFs to CFPs...........anyway I made this change to the .bat file and it works just fine with V3 Beta......excuse me for being such a pest.
  No one else reported this ??????

…thanks again

P.S. The topic discription implys this script is for V3 ALPHA , but it also works with V3 BETA.
Maybe the topic discription should reflect that. Oh well, just a thought.

Thanks for that and my apologies for not getting all the changes right.

In a way, this script becomes redundant now the beta is out, as it handles backups natively and for multiple configurations as well.

Cheers,
Ewen :slight_smile: