Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- :: Set the window size
- mode con: cols=55 lines=10
- :loop
- cls
- echo Saved uptime stats
- echo.
- :: Save the current date, time, and uptime to the file
- echo %date% %time% >> uptime.txt
- net statistics workstation | find "Statistics since" >> uptime.txt
- echo. >> uptime.txt
- :: Display the current uptime on the screen
- setlocal enabledelayedexpansion
- for /f "tokens=3,*" %%a in ('net statistics workstation ^| find "Statistics since"') do (
- set uptime=%%a %%b
- )
- echo Current Uptime: %uptime%
- endlocal
- :: Wait for 5 minutes (300 seconds)
- timeout /t 300 /nobreak > nul
- goto loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement