Simple Script for Firewall

Just save below script as cmd, then run taskschd.msc in order to schedule a backup for Comodo Firewall

This is based in Portuguese (for English (e.g.) could replace to “set dia=%date:~3,2%”, “set mes=%date:~0,2%” (on “DOS” (cmd), type “date”; %date:~0,2% start from 0, and get 2 next strings)

  • REGEDIT /E does not work with set environment in tests that I made, hence need to set accurate path to files, I’m copying files into Google Drive folder.

  • add an [at] symbol before “echo off” on script below


echo off
title Backup Comodo Firewall
set dia=%date:~0,2%
set mes=%date:~3,2%
set ano=%date:~-4%

REGEDIT /E “C:\Users<Your Name>\Google Drive\Backup\Comodo\CPFRUles.REG” “HKEY_LOCAL_MACHINE\SYSTEM\Software\COMODO\Firewall Pro”
if exist “C:\Users<Your Name>\Google Drive\Backup\Comodo\CPFRUles.REG” (
ren “C:\Users<Your Name>\Google Drive\Backup\Comodo\CPFRUles.REG” %ano%-%mes%-%dia%-CPFRUles.REG
)
if %ERRORLEVEL% EQU 1 echo Backup Failed
if %ERRORLEVEL% EQU 0 echo Backup Ok
pause > nul