The3vilM0nk3y

Untitled

Apr 22nd, 2016
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. @ECHO OFF
  2.  
  3. TITLE Sleep Timer
  4.  
  5. :menu
  6. CLS
  7. ECHO Welcome to the sleep timer script for Windows created by The3vilM0nk3y
  8. ECHO -------------------------
  9. ECHO ^| 1 Set Sleep Timer ^|
  10. ECHO ^| 2 Cancel Sleep Timer ^|
  11. ECHO ^| 3 Close Sleep Timer ^|
  12. ECHO -------------------------
  13. SET /P selection=Enter option number:
  14. IF "%selection%"=="1" GOTO enterTime
  15. IF "%selection%"=="2" GOTO cancelShutdown
  16. IF "%selection%"=="3" GOTO EXIT
  17. ECHO That is not a valid input. Please enter 1 2 or 3.
  18.  
  19. :cancelShutdown
  20. ECHO Shutdown succesfully aborted.
  21. timeout 3
  22. GOTO menu
  23.  
  24. :enterTime
  25. SET /P sleeptime=Enter Sleep Time in Minutes:
  26. IF "%sleeptime%"=="0" GOTO tooLittle
  27. IF "%sleeptime%"=="" GOTO enterValue
  28. ECHO Setting automatic shutdown to %sleeptime% minutes.
  29. SET /A sleeptime *=60
  30. SHUTDOWN -s -f -t %sleeptime% -c "Shutdown timer has been set, use option 2 to cancel it."
  31. GOTO menu
  32.  
  33. :tooLittle
  34. ECHO Sleep time must be greater than 0 minutes.
  35. pause
  36. GOTO enterTime
  37.  
  38. :enterValue
  39. ECHO You must enter a number greater than 0. The number represents how many minutes till the computer will shutdown.
  40. pause
  41. GOTO enterTime
Advertisement
Add Comment
Please, Sign In to add comment