Advertisement
Guest User

Continuous Tracert with timestamped logging

a guest
Oct 11th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.16 KB | None | 0 0
  1. echo off
  2. cls
  3. color 1F
  4. title Continuous Traceroute (with timestamped logging)
  5. echo.
  6. echo The results will be logged as a .txt file on your desktop.
  7. echo If you get any errors, run this script as administrator.
  8. echo.
  9. echo Please enter the desired name of the tracert log file.
  10. echo Do not include spaces or odd characters.
  11. echo Don't include .txt extension; it will be added automatically.
  12. set /p FILE=Filename:
  13. echo Results: > %UserProfile%\Desktop\%FILE%.txt
  14. echo.
  15. set /p IP=Enter name or IP address to trace route to:
  16. echo.
  17. cls
  18. echo Now logging results to %UserProfile%\Desktop\%FILE%.txt
  19. echo Close this window when you want to stop.
  20. echo If this window turns red at any point, it indicates an error or timeout.
  21. :start
  22. time /t
  23. echo.
  24. echo Tracing route to %IP%...
  25. echo.
  26. echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> %UserProfile%\Desktop\%FILE%.txt
  27. echo The current time is: >> %UserProfile%\Desktop\%FILE%.txt
  28. time /t >> %UserProfile%\Desktop\%FILE%.txt
  29. Tracert %IP% >> %UserProfile%\Desktop\%FILE%.txt
  30. if errorlevel ==1 (
  31.     color cf
  32.     echo Error or timeout detected!
  33.     echo Check %UserProfile%\Desktop\%FILE%.txt for details.)
  34. goto start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement