Advertisement
TechManDylan

gabage

Nov 4th, 2024 (edited)
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. @echo off
  2.  
  3. :: Set the window size
  4. mode con: cols=55 lines=10
  5.  
  6. :loop
  7. cls
  8. echo Saved uptime stats
  9. echo.
  10.  
  11. :: Save the current date, time, and uptime to the file
  12. echo %date% %time% >> uptime.txt
  13. net statistics workstation | find "Statistics since" >> uptime.txt
  14. echo. >> uptime.txt
  15.  
  16. :: Display the current uptime on the screen
  17. setlocal enabledelayedexpansion
  18. for /f "tokens=3,*" %%a in ('net statistics workstation ^| find "Statistics since"') do (
  19. set uptime=%%a %%b
  20. )
  21. echo Current Uptime: %uptime%
  22. endlocal
  23.  
  24. :: Wait for 5 minutes (300 seconds)
  25. timeout /t 300 /nobreak > nul
  26. goto loop
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement