I am planning an easy protection of my WINHOTEL data against ransom ware.
As I know that in my data folder should only be dbf, ftp and cdx files I thought I could have a FW program running at startup and checking all the winhotel data folders.
If there is a file with a different filename we should shutdown the sever.
Do you think we can program such a software.
It would be good if this could be a service.
How do we start the program best?
How could we restart the server that we do not run in a loop after an attack.
Thank you for your help in advace
Otto
- Code: Select all Expand view RUN
#include "FiveWin.ch"
static oWnd, oTimer
//----------------------------------------------------------------------------//
function Main()
DEFINE DIALOG oWnd FROM 3, 3 TO 20, 50 ;
TITLE OemToAnsi( "Testing timers" )
ACTIVATE DIALOG oWnd ;
ON INIT StartTimer()
return nil
//----------------------------------------------------------------------------//
function StartTimer()
DEFINE TIMER oTimer OF oWnd ;
INTERVAL 300 ;
ACTION ( check() )
ACTIVATE TIMER oTimer
return nil
//----------------------------------------------------------------------------//
function check()
local aDir := directory( "x:\xwhdaten\DATAWIN\" + "*.*","DHS")
local I := 1
local cFilename := ""
local lFehler := .f.
local cFehler := ""
oTimer:Deactivate()
FOR I := 1 to len( aDir )
lFehler := .T.
if aDir[ I , 1 ] <> "."
if ALLTRIM ( UPPER( cFileExt( aDir[ I , 1 ] ) ) ) = "DBF"
lFehler := .f.
endif
if UPPER( cFileExt( aDir[ I , 1 ] ) ) = "FPT"
lFehler := .f.
endif
if UPPER( cFileExt( aDir[ I , 1 ] ) ) = "CDX"
lFehler := .f.
endif
if lFehler = .t.
cFehler += aDir [ I, 1 ] + CRLF
FWLOG cFehler
winexec( "abmelden.bat" )
endif
endif
next
oTimer:activate()
return nil