turt2live

Untitled

Dec 29th, 2011
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.95 KB | None | 0 0
  1. @echo off
  2. cd C:\DOCUME~1\ADMINI~1\Desktop
  3. SET H=%TIME:~0,2%
  4. SET M=%TIME:~3,2%
  5. SET S=%TIME:~6,2%
  6. SET T=%H%_%M%_%S%
  7. SET D=%DATE:~4,2%
  8. SET M=%DATE:~7,2%
  9. SET Y=%DATE:~10,4%
  10. SET D=%D%_%M%_%Y%
  11. SET T=%T: =0%
  12. SET D=%D: =0%
  13. SET dir=%CD%
  14. SET P=%dir%\connection_logs\%D%\%T%\
  15. IF not exist %P% md %P%
  16. SET LOG=%P%console_log.txt
  17. echo Starting...
  18. echo [%DATE% %TIME%] Starting... >> %LOG%
  19. echo Setting file locations...
  20. echo [%DATE% %TIME%] Setting file locations... >> %LOG%
  21. SET Fports=%P%ports.txt
  22. SET Fporta=%P%allports.txt
  23. SET Fether=%P%ethernet.txt
  24. SET Fexels=%P%ports_files.txt
  25. SET Fexeal=%P%allports_files.txt
  26. SET Froutt=%P%routing_table.txt
  27. SET Fproto=%P%protocol_stats.txt
  28. SET Fprout=%P%protocol_stats_and_routing_table.txt
  29. echo Report directory: %P%
  30. echo [%DATE% %TIME%] Report directory: %P% >> %LOG%
  31. echo Log file: %LOG%
  32. echo [%DATE% %TIME%] Log file: %LOG% >> %LOG%
  33. echo Creating basic report.
  34. echo [%DATE% %TIME%] Creating basic report. >> %LOG%
  35. netstat -o > %Fports%
  36. echo Creating detailed report.
  37. echo [%DATE% %TIME%] Creating detailed report. >> %LOG%
  38. netstat -a -o > %Fporta%
  39. echo Creating super detailed report.
  40. echo [%DATE% %TIME%] Creating super detailed report. >> %LOG%
  41. netstat -b -o > %Fexels%
  42. echo Creating super super detailed report.
  43. echo [%DATE% %TIME%] Creating super super detailed report. >> %LOG%
  44. netstat -a -b -o > %Fexeal%
  45. echo Creating ethernet report.
  46. echo [%DATE% %TIME%] Creating ethernet report. >> %LOG%
  47. netstat -e > %Fether%
  48. echo Creating routing tables report.
  49. echo [%DATE% %TIME%] Creating routing tables report. >> %LOG%
  50. netstat -r > %Froutt%
  51. echo Creating protocol stats report.
  52. echo [%DATE% %TIME%] Creating protocol stats report. >> %LOG%
  53. netstat -s > %Fproto%
  54. echo Creating protocol stats with routing table report.
  55. echo [%DATE% %TIME%] Creating protocol stats with routing table report. >> %LOG%
  56. netstat -r -s > %Fprout%
  57. echo [%DATE% %TIME%] Done! >> %LOG%
  58. echo Done! Press any key to continue...
  59. pause > nul
Advertisement
Add Comment
Please, Sign In to add comment