Welcome, Guest. Please login or register.
November 16, 2009, 11:59:35 AM

Login with username, password and session length

334997 Posts
37062 Topics
84016 Members

Latest Member: barsim

Search:     Advanced search | Tag Cloud
+  Welcome to the Comodo Forum
|-+  Archive Boards
| |-+  Comodo Firewall
| | |-+  Help for v2
| | | |-+  Script to Backup CPF v2.4 firewall settings
« previous next »
Pages: 1 2 [3] 4 5 ... 11 Go Down Print
Author Topic: Script to Backup CPF v2.4 firewall settings  (Read 84725 times)
Rotty
Global Moderator
Comodo's Hero
*****
Offline Offline

Posts: 892


http://www.venganza.org/ - Noodly Appendage


« Reply #30 on: November 04, 2006, 11:05:22 PM »

I'm glad you have found it of use.  If any more programming projects i can see that may come up with COMODO products i will have to make a thread advertising the idea and try to attract any hobiest or professional programmers into it (Depending on size, whether it is outside the spare time panic and I have.)

cheers, rotty
Logged

The opinions expressed in my posts are my own. 
They do NOT necessarily represent or reflect the views of my employer.
apache255
Guest
« Reply #31 on: November 21, 2006, 04:27:08 PM »

just tried version 1.2 and ended up wth error messages in the console, and empty folders created everywhere...well not everywhere but one called document on C, and a few others around the zip file. Are you supposed to run this file from a special folder? Anyway could anybody tell me where the cpf rules are stored in the registry. Even if the script can work, I'd like to know where cpf locates Network Rules in the registry.Thanks for your help.
Logged
Little Mac
Global Moderator
Comodo's Hero
*****
Offline Offline

Posts: 6254



« Reply #32 on: November 21, 2006, 05:50:33 PM »

I also just ran v1.2.  It created the following chain of folders (within the folder I ran it from):

Users.WINDOWS/CPFBackup/Prior  (Capitalizations, etc are exact to what was created).

Folder "Prior" is apparently empty.

The zipped file was unpacked, and I ran the batch file.  The DOS window showed what would seem to be the proper sequence, and said it was done.

I have not installed the Beta; I have CPF v.2.3.6.81

LM

Logged

You read my sig block.  That's enough personal interaction for one day. Kewl
apache255
Guest
« Reply #33 on: November 21, 2006, 06:05:21 PM »

anybody knows if the backup script 1.2 works at all with cpf beta 2.4?
Logged
panic
Global Moderator
Comodo's Hero
*****
Offline Offline

Posts: 7454


... and I say to myself, "What a wonderful world"


« Reply #34 on: November 21, 2006, 08:01:02 PM »

just tried version 1.2 and ended up wth error messages in the console, and empty folders created everywhere...well not everywhere but one called document on C, and a few others around the zip file. Are you supposed to run this file from a special folder? Anyway could anybody tell me where the cpf rules are stored in the registry. Even if the script can work, I'd like to know where cpf locates Network Rules in the registry.Thanks for your help.

I'm looking into it now. Will post back shortly.

cheers,
ewen :-)
Logged

As your mums would say, "If you can't play nice with all the other kiddies, go home".
All users are asked to please read and abide by the  Comodo Forum Policy.
If you don't like it, don't use the forum.
panic
Global Moderator
Comodo's Hero
*****
Offline Offline

Posts: 7454


... and I say to myself, "What a wonderful world"


« Reply #35 on: November 21, 2006, 11:00:23 PM »

G'day,

There is a problem with the 1.2 script.

It uses the %allusersprofile% system variable, and by default, this variable is set to "C:\Documents and Settings\All Users". Note the SPACE between the word "Documents" and the word "and".

Due to the way CMD.EXE parses script commands, if a sequence of characters that contains one or more SPACE characters isn't enclosed within quotation marks, CMD.EXE interprets the string UP TO THE FIRST SPACE only as a command. As the script is fed a variable which has to be substituted with the current value of the variable (C:\Documents and Settings\All Users), CMD.EXE only interprets up to the first space character.

This is why we end up with a folder in the root of dirve C: called "C:\DOCUMENTS".

How to get around this?

The easiest way is to edit the script and replace all instances of "%ALLUSERSPROFILE%" with a location of your choice, preferably a second hard drive or a removable storage device (There's little sense storing a backup of your firewall rules on the same hard drive).

IMHO, I would stick to V1.1 of the script. The BEST alternative is to modify V1.1 to suit your particular requirements. The scripts were developed by Rotty as a simple means of capturing and restoring the current config in the event of a reinstall wiping out the current rule/app set (as happens between major revisions).

An example of an edited V1.1 script is below. This example creates a folder in the root of drive D: called "CPFBackup" with a sub-folder called "Prior". It has also added some text to remind users to turn off the registry protection in CPF before running the backup.

Cut and paste the code that is shown in RED into notepad (or any other text editor) and save it as a .BAT file. If using notepad, remember to change the file type from TEXT to ALL FILES. Also, remember to change the "[at] " sequence in the top line of the code to the real "at" symbol before saving.

SAMPLE CODE

********************************************

[at]echo off
cls
echo *****************************
echo The settings are backed up to d:\CPFBackup\CPFRUles.REG
echo Merge the "CPFrules.reg" file back, to restore settings
echo *****************************
echo.
echo.
echo Before continuing, turn off registry protection in CPF.
echo.
echo This is found in SECURITY - ADVANCED - MISCELLANEOUS
echo.
echo.
echo To start press enter. To quit press the "x" button on this window
pause >nul:

cls
if not exist d:\CPFBackup goto :new
goto :archive

:archive
echo Clearing oldest backup - please wait
del d:\CPFBackup\Prior\CPFRUles.REG >nul:
echo Storing previous backup - please wait ...
copy d:\CPFBackup\CPFRUles.REG d:\CPFBackup\Prior\CPFRUles.REG
echo Archiving current rule set - please wait ...
REGEDIT /E d:\CPFBackup\CPFRUles.REG "HKEY_LOCAL_MACHINE\SYSTEM\Software\Comodo\Personal Firewall"
goto :end

:new
cls
echo.
echo Creating folders - please wait ...
echo.
md d:\CPFBackup
md d:\CPFBackup\Prior
echo Archiving registry keys - please wait ...
REGEDIT /E d:\CPFBackup\CPFRUles.REG "HKEY_LOCAL_MACHINE\SYSTEM\Software\Comodo\Personal Firewall"
copy d:\CPFBackup\CPFRUles.REG d:\CPFBackup\Prior\CPFRUles.REG >nul:
goto :end

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

***************************************************

Hope this helps, and sorry for the screw up.

Cheers,
Ewen :-)
Logged

As your mums would say, "If you can't play nice with all the other kiddies, go home".
All users are asked to please read and abide by the  Comodo Forum Policy.
If you don't like it, don't use the forum.
apache255
Guest
« Reply #36 on: November 22, 2006, 03:28:18 AM »

 Wave

hi Ewen!
 well thanks very much for your detailed answer concerning the script. I'm gonna try this today

                                                   cheers
                                                   Apache
Logged
Rotty
Global Moderator
Comodo's Hero
*****
Offline Offline

Posts: 892


http://www.venganza.org/ - Noodly Appendage


« Reply #37 on: November 22, 2006, 04:55:50 AM »

I don't know if it will work with 2.4 beta, maybe panic can test that some time.

I don't have a test environment, sniff.

if the registry entries are in the same place as they were with 2.3, then their SHOULD not be a problem.  Since you are using the beta which usually signifies that you have a test environment, then you could test it for us if you want (-:

cheers, rotty
Logged

The opinions expressed in my posts are my own. 
They do NOT necessarily represent or reflect the views of my employer.
Little Mac
Global Moderator
Comodo's Hero
*****
Offline Offline

Posts: 6254



« Reply #38 on: November 22, 2006, 11:15:51 AM »

TNX for your time and effort, guys, to investigate and edit the script.

I changed it to send to my flash drive; it appears to have worked fine, as I now have a registry backup file on there.

Ultimately, does the destination truly matter?  I mean, even if it were set to save it on the C:\ drive (assuming that to be the system drive), as long as the user knows the location, they can move the entire file off-system to another drive, CD, etc.  Is that correct, or does something else factor in that would make that impossible?

Thanks again,

LM
Logged

You read my sig block.  That's enough personal interaction for one day. Kewl
apache255
Guest
« Reply #39 on: November 22, 2006, 11:40:01 AM »

thanks panic, I've jsut tried your script on the beta and it worked just fine. I got 2 identical backups, one directly under cpfbackup and a second one under a subfolder called prior...strange but it does not matter.Once again good job.


                                     cheers
                                      Cheers
Logged
panic
Global Moderator
Comodo's Hero
*****
Offline Offline

Posts: 7454


... and I say to myself, "What a wonderful world"


« Reply #40 on: November 22, 2006, 03:17:21 PM »

thanks panic, I've jsut tried your script on the beta and it worked just fine. I got 2 identical backups, one directly under cpfbackup and a second one under a subfolder called prior...strange but it does not matter.Once again good job.


                                     cheers
                                      Cheers

The folder and the subfolder hold the current ruleset and the previous set, respectively, just to give us a better fallback postition.

cheers, and glad to hear it worked!

ewen :-)
Logged

As your mums would say, "If you can't play nice with all the other kiddies, go home".
All users are asked to please read and abide by the  Comodo Forum Policy.
If you don't like it, don't use the forum.
panic
Global Moderator
Comodo's Hero
*****
Offline Offline

Posts: 7454


... and I say to myself, "What a wonderful world"


« Reply #41 on: November 22, 2006, 03:20:29 PM »

TNX for your time and effort, guys, to investigate and edit the script.

I changed it to send to my flash drive; it appears to have worked fine, as I now have a registry backup file on there.

Ultimately, does the destination truly matter?  I mean, even if it were set to save it on the C:\ drive (assuming that to be the system drive), as long as the user knows the location, they can move the entire file off-system to another drive, CD, etc.  Is that correct, or does something else factor in that would make that impossible?

Thanks again,

LM
Does the destination matter? Yes, - the sense is storing your backups on the drive that are backing up is what??? LOL

The REG file can be transpported anywhere!

ewen :-)
Logged

As your mums would say, "If you can't play nice with all the other kiddies, go home".
All users are asked to please read and abide by the  Comodo Forum Policy.
If you don't like it, don't use the forum.
Little Mac
Global Moderator
Comodo's Hero
*****
Offline Offline

Posts: 6254



« Reply #42 on: November 22, 2006, 05:36:09 PM »

Does the destination matter? Yes, - the sense is storing your backups on the drive that are backing up is what??? LOL

The REG file can be transpported anywhere!

ewen :-)


I guess my question was, are three different scripts for different file destinations really needed?  Why not just one script with a known save location (whatever that might be) with the statement that the user needs to move the file off-system to another drive. 

I totally get the point of not having it on the drive that's gonna crash.  I may not know much (and I am from Texas...), but I know THAT much.  Wasn't born yesterday.  Wink  LOL

LM
Logged

You read my sig block.  That's enough personal interaction for one day. Kewl
panic
Global Moderator
Comodo's Hero
*****
Offline Offline

Posts: 7454


... and I say to myself, "What a wonderful world"


« Reply #43 on: November 23, 2006, 12:30:55 AM »

I guess my question was, are three different scripts for different file destinations really needed?  Why not just one script with a known save location (whatever that might be) with the statement that the user needs to move the file off-system to another drive. 

I totally get the point of not having it on the drive that's gonna crash.  I may not know much (and I am from Texas...), but I know THAT much.  Wasn't born yesterday.  Wink  LOL

LM

Rotty wrote the three versions to try and satify the differing requests he received after the wrote the first, palin vanilla one. We have added some hints on how to modify (e.g by using %1 to represent a pramater passed at the command line, etc.) but a lot of people's collective eyes glazed over when we started talking DOS. LOL

I agree, one straight forward version would be best, but its only best for those who can modify to suit their explicit needs.


Cheers LM,
Ewen :-)

Logged

As your mums would say, "If you can't play nice with all the other kiddies, go home".
All users are asked to please read and abide by the  Comodo Forum Policy.
If you don't like it, don't use the forum.
panic
Global Moderator
Comodo's Hero
*****
Offline Offline

Posts: 7454


... and I say to myself, "What a wonderful world"


« Reply #44 on: November 27, 2006, 08:21:02 AM »

Hey Rotty,

Have a look at

http://forums.comodo.com/index.php/topic,4128.msg31222.html#msg31222

Your scripts been adapted to backup the Comodo Backup jobs and settings.

Thanks again,
Ewen :-)
Logged

As your mums would say, "If you can't play nice with all the other kiddies, go home".
All users are asked to please read and abide by the  Comodo Forum Policy.
If you don't like it, don't use the forum.
Tags:
Pages: 1 2 [3] 4 5 ... 11 Go Up Print 
« previous next »
Jump to:  

SSL Certificate Free Virus Removal Firewall
Page created in 0.052 seconds with 18 queries.
Powered by SMF 1.1.10 | SMF © 2006, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks
Design by 7dana.com