Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- cd C:\DOCUME~1\ADMINI~1\Desktop
- SET H=%TIME:~0,2%
- SET M=%TIME:~3,2%
- SET S=%TIME:~6,2%
- SET T=%H%_%M%_%S%
- SET D=%DATE:~4,2%
- SET M=%DATE:~7,2%
- SET Y=%DATE:~10,4%
- SET D=%D%_%M%_%Y%
- SET T=%T: =0%
- SET D=%D: =0%
- SET dir=%CD%
- SET P=%dir%\connection_logs\%D%\%T%\
- IF not exist %P% md %P%
- SET LOG=%P%console_log.txt
- echo Starting...
- echo [%DATE% %TIME%] Starting... >> %LOG%
- echo Setting file locations...
- echo [%DATE% %TIME%] Setting file locations... >> %LOG%
- SET Fports=%P%ports.txt
- SET Fporta=%P%allports.txt
- SET Fether=%P%ethernet.txt
- SET Fexels=%P%ports_files.txt
- SET Fexeal=%P%allports_files.txt
- SET Froutt=%P%routing_table.txt
- SET Fproto=%P%protocol_stats.txt
- SET Fprout=%P%protocol_stats_and_routing_table.txt
- echo Report directory: %P%
- echo [%DATE% %TIME%] Report directory: %P% >> %LOG%
- echo Log file: %LOG%
- echo [%DATE% %TIME%] Log file: %LOG% >> %LOG%
- echo Creating basic report.
- echo [%DATE% %TIME%] Creating basic report. >> %LOG%
- netstat -o > %Fports%
- echo Creating detailed report.
- echo [%DATE% %TIME%] Creating detailed report. >> %LOG%
- netstat -a -o > %Fporta%
- echo Creating super detailed report.
- echo [%DATE% %TIME%] Creating super detailed report. >> %LOG%
- netstat -b -o > %Fexels%
- echo Creating super super detailed report.
- echo [%DATE% %TIME%] Creating super super detailed report. >> %LOG%
- netstat -a -b -o > %Fexeal%
- echo Creating ethernet report.
- echo [%DATE% %TIME%] Creating ethernet report. >> %LOG%
- netstat -e > %Fether%
- echo Creating routing tables report.
- echo [%DATE% %TIME%] Creating routing tables report. >> %LOG%
- netstat -r > %Froutt%
- echo Creating protocol stats report.
- echo [%DATE% %TIME%] Creating protocol stats report. >> %LOG%
- netstat -s > %Fproto%
- echo Creating protocol stats with routing table report.
- echo [%DATE% %TIME%] Creating protocol stats with routing table report. >> %LOG%
- netstat -r -s > %Fprout%
- echo [%DATE% %TIME%] Done! >> %LOG%
- echo Done! Press any key to continue...
- pause > nul
Advertisement
Add Comment
Please, Sign In to add comment