Advertisement
Guest User

Automatic shutdown batch file

a guest
Sep 13th, 2022
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.56 KB | Source Code | 0 0
  1. @echo off
  2. cls
  3. :hour
  4. set hour=
  5. set /P hour=Enter how many hours until shutdown: %=%
  6. echo hour = %hour%
  7. :minute
  8. set minute=
  9. set /P minute=Enter how many minutes until shutdown: %=%
  10. echo minute = %minute%
  11. set /A realhour = hour * 60
  12. set /A hoursANDminutes = realhour + minute
  13. set /A total = hoursAndminutes * 60
  14. echo Your computer will shut off in %total% seconds.
  15. echo Starting the sleep process ...
  16. sleep total
  17. echo Computer is shutting down in:
  18. echo 5
  19. sleep 10
  20. echo 4
  21. sleep 10
  22. echo 3
  23. sleep 10
  24. echo 2
  25. sleep 10
  26. echo 1
  27. sleep 10
  28. shutdown -s -t 00
Tags: batch file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement