Alright... In this instructable I will show you how to create an alarm in a batch file. When activated, a tone will come from the internal speaker of your computer, over, and over. If you are lazy, you can just download it in the last step!I highly advise you not to play around with batch if you are not familiar with it! If you aren't, check out these basic,Intermediate, and advanced, batch tutorials.

Step 1: Capture the "Alarm"

In order to create an alarm, we will need a sound. There is a special character that when in a batch file or entered in command prompt, will cause an error and a tone will play through the internal speaker. In order to get that special character, you need to do a key combo in command prompt then save it so you can copy and paste it. That's what I'll do in the next few steps.

Step 2: Open Command Prompt

Goto start> run, then type in cmd, then press OK


Goto start> All Programs> Accessories> Command Prompt

Step 3: Change Directory

Once in command prompt, type
cd desktop
That will change the directory command prompt is in, to the desktop.

Step 4: Echo, ECHO!

Now that you've navigated to the desktop, type this:
echo @echo 

Step 5: Key Combo

Now hold down ALT & 7 (must be on the numpad) at the same time. "/\G" should appear. See picture.

Step 6: Save As Batch

Now Type:
">" means "output" and "alarm.bat" is what you are outputting.
Make sure you remember the ".bat" part, or it won't be saved as a batch file.

Step 7: Obtain the Character

Right click on the newly created batch file and click Edit. Then select the box looking letter that is the character, and copy it. You've now successfully captured the rare alarm character! Clap Clap Clap...

Step 8: Delete

You can now delete the file "Alarm.bat"

Step 9: Alarm Code

First, open Notepad. Then type:
@echo off:alarm
"@echo off" means that it won't show you whats happening. Keeps batch files clean.
":alarm" is a label
Then paste the special character in a new line under that.
Next type in the next line:
clsgoto alarm
"cls" means clear screen. It just removes everything on screen off the command prompt. Sorta like a dry erase board. "goto alarm" means that it will goto the label ":alarm"

Step 10: Save As

Goto File> Save As, and save it as "Alarm.bat"

Step 11: Done!

You can now run the batch file "Alarm.bat" and it will sound an alarm through your computer speakers! One neat thing to do is if you have a password protected batch file, you can sound an alarm if they get the password wrong! Another thing you can do, is make an alarm clock! Good luck, and have fun!
<p>When we create alarm with batch files. Can we use other songs eg.*.MP3 .</p>
For the people who don't have number pads to get the "special character" just go to the character map tool, pick any font, and go to unicode 2022. (Bullet)
Actually, I thought everyone had a number pad. On most laptops, there are number pad key markings on a set of keys on the right side of your keyboard - to use them, hold Fn and press one. (For example, to get a NumPad0 on my laptop (very important for the Alt+0160 character!) I press Fn+M.)
<p>not all special symbols are valid, batch file or cmd only read special ASCII symbols. go get ASCII symbols that valid for batch file and cmd, get it here </p><p>http://textuploader.com/tprq</p>
<p>this is cool, but i made my own batch file, that allow you to download file from internet, just like download manager. please visit this instructables</p><p>https://www.instructables.com/id/How-To-download-File-on-internet-using-batch-file/</p><p>thanks dude!</p>
where do you think i should add the alarm code to in this locker code: <br>@ECHO OFF <br>title Folder Private <br>if EXIST &quot;Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}&quot; goto UNLOCK <br>if NOT EXIST Private goto MDLOCKER <br>:CONFIRM <br>echo Are you sure you want to lock the folder(Y/N) <br>set/p &quot;cho=&gt;&quot; <br>if %cho%==Y goto LOCK <br>if %cho%==y goto LOCK <br>if %cho%==n goto END <br>if %cho%==N goto END <br>echo Invalid choice. <br>goto CONFIRM <br>:LOCK <br>ren Private &quot;Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}&quot; <br>attrib +h +s &quot;Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}&quot; <br>echo Folder locked <br>goto End <br>:UNLOCK <br>echo Enter password to unlock folder <br>set/p &quot;pass=&gt;&quot; <br>if NOT %pass%== 345742 goto FAIL <br>attrib -h -s &quot;Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}&quot; <br>ren &quot;Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}&quot; Private <br>echo Folder Unlocked successfully <br>goto End <br>:FAIL <br>echo Invalid password <br>goto end <br>:MDLOCKER <br>md Private <br>echo Private created successfully <br>goto End <br>:End
how do i add the alarm batch file to my Locker batch file?
it didn't work, can you help me <br>
you can use ctrl+G too!
I clicked on your link and got this: <br> <br>@echo off <br>color fa <br>title password required <br>set tries=4 <br>:top <br>cls <br>set /a tries=%tries%-1 <br>if %tries% equ 0 (goto penalty) <br>echo you have %tries% attempts left. <br>echo please enter password <br>set /p password= <br>if %password%==boom (start www.google.com) <br>goto top <br>:penalty <br>exit <br> <br>It works fine but I can't change the destination when you get the password right to a vbs, other batch, file folder, or word doc. Plz help
Heres the code you wanted<br><br>@echo off<br>color fa<br>title password required<br>set tries=4<br>:menu<br>if exist pass.bat goto top<br>goto passme<br>:passme<br>set /p pass=Enter Password:<br>echo set pass=%pass%&gt;pass.bat<br>goto top<br>:top<br>cls<br>set /a tries=%tries%-1<br>if %tries% equ 0 (goto penalty)<br>echo you have %tries% attempts left.<br>set /p password=Please Enter Password:<br>call pass.bat<br>if %password%==%pass%(goto start<br>:start<br>start www.google.com<br>goto good<br>:good<br>echo Password Right<br>pause<br>:penalty<br>exit
It dosen't work!!! all it says is &quot;&nbsp;&nbsp; &quot;&quot; is not recognized as a internal or external command... etc.&quot;
I NEED to know how to exit this thing!
press ctrl + c and then close the cmd window
you just close cmd. that works for me!
what would be a script for a password that if typed incorrectly, the alarm would sound, all I see here are bits and pieces and I don't understand exactly what to type into notepad.
If you don't know how to put it together, then I don't think you should even try. Read some basic batch tutorials or 'ibles first.
good for you i got it thanks kidu
Hey dude thanks for posting this i used your program to create a<strong> timer batch command!!</strong> i thing i might make a instructable for it ill give u credit for the alarm.<br /> <br />
I did all what u said... And I cant close it when I opet it... But im not hearing any beeping :S&nbsp;Why's that?<br />
You shouldn't be able to close it. You might have your internal speaker disabled in the bios.<br />
how do u shut it off if u make it yourself? im not gonna make it till i no!!
u can just exit it like any old window
If you convert it to exe, u cant.
right, except its not an exe...<br />
cool! thanx
Restart Computer.
like, if u turn down ur speakers, will it go away?
it comes from the internal speaker......
I tried this, it's pretty cool, but I can't close the window or stop the beeping!
That's the point, it's an alarm. ; )<br/><sub><sup>(Try turning off a car alarm when you're the burglar!) </sup></sub><br/>
so how do you get it off?
Well, read the rest of the comments and you might learn how.<br />
how come it shows up note pad with @echo and a dot?
it might not work, but you don't save it as a *.txt file. you select 'all files' when you are saving and save it as a *.bat file. i tihnk *.cmd files work too. but *.bat is just a lot more common
Yes, it does. The &quot;<em>desktop</em>&quot; is really %userprofile%\desktop. <em>Most</em> Command Prompts start in %userprofile%, so &quot;cd desktop&quot; changes the directory to %userprofile%\desktop.<br/>
Uh, why? Are you a spambot?
ok, i love the idea, but i can't get it to work. can one of you send me the outling to put in, with details of where to put the password, it isnt very clear in any of these. by the way, i want it so if it is the wrong password, the alarm soungs, and if it is right, it will go to whatever programmong i put in such as messages, opening folders and files, ect. thanks.
<a href="https://www.instructables.com/id/Password-Protection-in-Batch/">https://www.instructables.com/id/Password-Protection-in-Batch/</a><br/>
I saw the same thing on <a rel="nofollow" href="http://kungscriptfu.blogspot.com/2009/05/how-to-program-batch-alarm-clock.html,">http://kungscriptfu.blogspot.com/2009/05/how-to-program-batch-alarm-clock.html,</a> and I think it was a little more clearly explained.<br/>
Umm... That's a dead link...
doesnt work on my comp probably cuz my comp is homebuilt and im not sure that the mobo i bought has an internal speaker and if you want to close it, just use task manager and kill cmd.exe
Almost <em>every</em> mobo has an internal speaker, but mostly it's disabled in the BIOS settings.<br/>
My brand new Gateway computer doesn't have one, but it has everything else!
Here is another guide to building a batch alarm clock if anyone is having trouble with this one.
It's not the alarm part that people are confused with, it's the password.
iI see a problem with the script that alot of people are having trouble with. When you get the password right, unless you put some sort of exit command after your program it will just do the alarm. A simple way to fix this would be to put the alarm loop before the rest of the program. example:<br/><br/><pre>@echo offtitle PasswordEcho Please enter password to proceed.set /p udefine=set variable1=(whatever)if %udefine%==%variable1% (goto correctcls)clscolor 0cecho Invalid Password!pausegoto alarm:alarmclsgoto alarm:correct</pre><br/>This way even if they don't put an exit command in the correct loop it doesn't sound the alarm. <br/>
How do you turn the password alarm thing off I typed the RIGHT password an the alarm went off and it's p!$$!n me off to the max! AND I don't wast to retart or shut down my computer!
I ment restart not retart

About This Instructable




Bio: One of my favorite hobbies is dismantling electronics, then either combining them together to create something new, or adding components to make them better. I ... More »
More by Arbitror:Voltage Horizon My Aquarium Ocean Storm Oil Painting 
Add instructable to: