Step 4: 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.

<p>you can put like :</p><p>start c:\music\&quot;any song.mp3&quot;</p><p>at the end</p>
<p>i did it </p>
<p>look here</p><p><a href="https://www.instructables.com/member/Batchcc?show=INSTRUCTABLES" rel="nofollow">https://www.instructables.com/member/Batchcc?show=I...</a></p><p>Full screen matrix to !!</p>
<p>Holy. Crap. Thank you for posting the exact code, because I'm an idoit and cant figure this out. You, sir, are the best.</p>
I know that it's not exactly a ding, but using Ctrl + G in batch causes a beep of sorts.
I think to do that you would have to replace the URLs with the document adress. Like for Windows you would do C:\Users\Person\Desktop\Programs <br>Thats my best guess.
Type this to make the ding sound (put this after echo (DING!): <br> <br>rem Making the temp file <br> :num <br> if exist temp%num%.vbs goto num <br> echo ' &gt; &quot;temp%num%.vbs&quot; <br> echo set speech = Wscript.CreateObject(&quot;SAPI.spVoice&quot;) &gt;&gt; &quot;temp%num%.vbs&quot; <br> echo speech.speak &quot;Ding!&quot; &gt;&gt; &quot;temp%num%.vbs&quot; <br> start temp%num%.vbs <br> pause <br> del temp%num%.vbs <br> pause
if u want to make the ding sound click on the bit where it says ding &amp; press Ctrl + Shift + G
Dude you are awesome do you have a youtube account making this ? <br>
In the part of the script where it says ding, press Ctrl+Shift+G and it should print a character that says BEL, highlited black. When you run it again, it will sound the system bell. you can also type this into cmd. Depending on the text editor u use, it may show it or not. I use Notepad++. Here is a list of other special commands(if you type them into cmd, most of the print out a character, such as a heart of spade.): <br> <br> ~ Shift + Esc = (ESC) <br> ~ Ctrl + E = (ENQ) <br> ~ Ctrl + R = (DC2) <br> ~ Ctrl + Pause\Break = (ETX) <br>&Acirc;&Acirc; ~ Ctrl + Shift + Y = (EM) <br> ~ Ctrl + Shift + W = (ETB) <br> ~ Ctrl + Shift + O = (SI) <br> ~ Ctrl + Shift + A = (SOH) <br> ~ Ctrl + Shift + D = (EOT) <br> ~ Ctrl + Shift + G = (BEL) <br> ~ Ctrl + Shift + H = (BS) <br> ~ Ctrl + Shift + Z = (SUB) <br> ~ Ctrl + Shift + X = (CAN) <br> ~ Ctrl + Shift + C = (ETX) <br> ~ Ctrl + Shift + v = (SYN) <br> ~ Ctrl + Shift + B = (STX) <br> ~ Ctrl + Shift + N = (SO) <br> ~ Ctrl + Shift + 6 + (RS) <br> ~ Ctrl + Shift + -(Dash) = (US) <br> <br>You may not be able to seem them up here, but the characters look like the ones in parenthesis ieg. (SUB), (BEL) <br>On some text editors, it they will show up like symbols. Note that these characters cannot be copied and pasted.
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.<br>if you have any questions or need the locker batch file email me at noah.hepworth@hotmail.com
@hwalker4<br><br>to open the file you cant just put:<br><br>&quot;C:\test.txt&quot;<br><br>you need:<br><br>start &quot;C:\test.txt&quot;<br><br>or to open a *.bat<br><br>call file.bat
yeah you could easily e.g<br>@echo off<br>cls<br>C:\file.txt<br><br>would open file.txt or..<br><br>just typing the file name should work
ok thanks
nice could i use it to acess folders and keep documents
I don't know how, but you probably could.<br>
wow got to do it

About This Instructable




More by jklujm:My Herringbone Gear Cool Batch Files Batch Tutorial Using Batch 
Add instructable to: