Advertisement
J2897

Simple Countdown Timer

Apr 1st, 2016
328
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.46 KB | None | 0 0
  1. :: Released under the GNU General Public License version 3+ by J2897.
  2.  
  3. @echo off
  4. cls
  5. setlocal
  6. color 1b
  7. title=Countdown Timer
  8.  
  9. REM #################### README #################### > BEGIN
  10. :: Filename:    countdown-timer.bat
  11. :: Version:     1.1
  12. :: Latest:      http://pastebin.com/UY6zmz3i
  13. :: Contact:     https://pastebin.com/message_compose?to=J2897
  14. ::
  15. :: This is a simple countdown timer I made. It simply uses Window's "timeout"
  16. :: Batch function. I made it because the Orzeszek Timer I normally use takes
  17. :: ages to load on my slow machine. And when I'm in a rush to start a timer,
  18. :: that can be pretty irritating.
  19. REM #################### README #################### > END
  20.  
  21. set /p "MINS=How many minutes?: "
  22. echo.
  23. set /a "SECS=MINS*60"
  24.  
  25. if %MINS% LSS 2 (
  26.     set MINUTES=minute
  27. ) else (
  28.     set MINUTES=minutes
  29. )
  30.  
  31. echo There are %SECS% seconds in %MINS% %MINUTES%.
  32. timeout /t %SECS%
  33.  
  34. set "VLC32=%SYSTEMDRIVE%\Program Files\VideoLAN\VLC\vlc.exe"
  35. set "VLC64=%SYSTEMDRIVE%\Program Files (x86)\VideoLAN\VLC\vlc.exe"
  36. set "OPTIONS=--repeat --ignore-config --no-qt-privacy-ask"
  37. set "AUDIO_FILE=%WINDIR%\Media\tada.wav"
  38.  
  39. if exist "%VLC64%" (
  40.     REM Use the 64-Bit version of VLC in repeat mode.
  41.     start "" "%VLC64%" %OPTIONS% "%AUDIO_FILE%"
  42. ) else (
  43.     if exist "%VLC32%" (
  44.         REM Use the 32-Bit version of VLC in repeat mode.
  45.         start "" "%VLC32%" %OPTIONS% "%AUDIO_FILE%"
  46.     ) else (
  47.         REM Resort to the default audio player.
  48.         start "" "%AUDIO_FILE%"
  49.     )
  50. )
  51.  
  52. color
  53. endlocal
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement