Step 4: Timer

Picture of Timer
A simple timer with a built-in calculator.

@echo off
color 0b
echo Welcome to the timer. This timer only counts seconds.
echo Type in the amount of seconds to count. The number may range from 0 to   
echo 99,999. If you need help converting minutes into seconds, type c for a
echo caculator.
set/p "time=>"
if %time%==c GOTO calc
if %time%==C GOTO calc
if %time% GTR 99999 GOTO bust
echo The time has been set! Press any key to start counting. You can stop the
echo timer by pressing any key. After stoping, the timer cannot continue.
color 0c
timeout %time%
echo (DING!)
goto menu
color 0a
echo Type the math problem below. This calculator doesn't accept decimals,
echo percents, etc. Only whole numbers.
set/p "math=>"
set/a nmath=%math%
echo %math%=%nmath%
echo Would you like to return to the timer or use the calculator again?
echo c or C= calculator
echo t or T= timer
set/p "route=>"
if %route%==c GOTO calc
if %route%==C GOTO calc
if %route%==t GOTO menu
if %route%==T GOTO menu

If anyone knows how, I'd like to know how to make some noise sound out when the timer
goes off. But only for a short time. I don't want to have it go on infinitely, because that would mean restarting the computer every time I use the timer.

Ink Ninja2 years ago
I know that it's not exactly a ding, but using Ctrl + G in batch causes a beep of sorts.
sam577192 years ago
Type this to make the ding sound (put this after echo (DING!):

rem Making the temp file
if exist temp%num%.vbs goto num
echo ' > "temp%num%.vbs"
echo set speech = Wscript.CreateObject("SAPI.spVoice") >> "temp%num%.vbs"
echo speech.speak "Ding!" >> "temp%num%.vbs"
start temp%num%.vbs
del temp%num%.vbs
sam577192 years ago
if u want to make the ding sound click on the bit where it says ding & press Ctrl + Shift + G
el-xavi262 years ago
Dude you are awesome do you have a youtube account making this ?
nhepworth3 years ago
if you want to make a sound go off for a timer what you could do is have an audio recording of a DING! sound or whatever. The you could use the START command to start the audio file, then to end the sound i am sure there is a close window command. However, i do not know of it because i have never had to use it. This would make it much more difficult to get off the internet though. You would have to compact the audio file into same folder as the batch file. Possibly you could variate the locker batch file that can be found online. This batch file hides things on the desk top until it is unlocked. You could variate that into your batch file so that it requires no password and only appears for a short time. thus you would be able to call upon an audio file that, in theory, be saved to the desktop.
if you have any questions or need the locker batch file email me at noah.hepworth@hotmail.com