greendevil

Speedtest CLI with logging

May 19th, 2021 (edited)
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. rem Create batch file in c:\\Speedtest\
  2. rem Download speedtest.exe by Ookla and place it there
  3. rem log.txt will also be there
  4.  
  5.  
  6.  
  7. @echo off
  8. rem ------------------------------------------------------------------------------------ Admin privs & window title ↓
  9. if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit /b)
  10. TITLE grn Δ Ookla Speedtest
  11. rem ------------------------------------------------------------------------------------ Check/create log.txt ↓
  12. :ONE
  13. echo Starting logs.
  14. if not exist log.txt (
  15. echo Creating log.txt
  16. echo >log.txt
  17. ) else (
  18. echo Log file exists. Appending data.
  19. )
  20. cls
  21. rem ------------------------------------------------------------------------------------ Graphics work ↓
  22. mode con: cols=50 lines=30
  23. rem ------------------------------------------------------------------------------------ Working script ↓
  24. >> log.txt echo ------BEGIN TEST------
  25. echo ------BEGIN TEST------
  26. >> log.txt echo ----%date%-%time%----
  27. echo ----%date%-%time%----
  28. >> log.txt c:\\speedtest\speedtest.exe -s 2453
  29. rem ------------------------------------------------------------------------------------ Print result in cmd ↓
  30. powershell.exe Get-Content log.txt -Tail 5
  31. rem ------------------------------------------------------------------------------------ Finish script ↓
  32. >> log.txt echo ----%date%-%time%----
  33. echo ----%date%-%time%----
  34. >> log.txt echo ------FINISH TEST------
  35. echo ------FINISH TEST------
  36. rem ------------------------------------------------------------------------------------ Wait 30 min ↓
  37. echo Test complete, please see result above.
  38. echo Test will repeat in 30 minutes.
  39. Timeout 1800
  40. goto ONE
Advertisement
Add Comment
Please, Sign In to add comment