Exit codes and other things
Ok, I'm messing around with DOS and am trying to create a very simple Intrusion Detection System. I'm new with this stuff, so if something I say doesn't make sense, please just tell me.
Basically, it runs Netstat, logs it, gives the user a list of options to stop or view the log, and if they don't choose an option in 5 seconds, it continues logging.
@echo off
goto net
:net
netstat>>log.txt
choice /c:csv /n /t:c,5 Press S to stop or V to view the log.
IF errorlevel 1 goto net
IF errorlevel 2 goto stop
IF errorlevel 3 goto view
:stop
echo You've stopped logging.
:view
start C:\Windows\log.txt
I also wanted to add an FC to compare the log to normal traffic, and then use IF with errorlevel to determine if there is an intruder. But I am not sure of the exit codes for the FC command. Can someone please explain exit codes to me?