Introduction: Create an Alarm in Batch

Picture of Create an Alarm in Batch

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"

Picture of 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

Picture of Open Command Prompt

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


Goto start> All Programs> Accessories> Command Prompt

Step 3: Change Directory

Picture of 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!

Picture of Echo, ECHO!
Now that you've navigated to the desktop, type this:
echo @echo 

Step 5: Key Combo

Picture of 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

Picture of 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

Picture of 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

Picture of Delete

You can now delete the file "Alarm.bat"

Step 9: Alarm Code

Picture of 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

Picture of 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!


Sembot (author)2017-09-16

how can i adjust the speed of moving , en make sound

goro nes (author)2014-08-19

When we create alarm with batch files. Can we use other songs eg.*.MP3 .

GameV8 (author)2008-05-16

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)

michaelb958 (author)GameV82010-12-10

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.)

Regulators (author)michaelb9582014-04-21

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

Regulators (author)2014-04-21

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

thanks dude!

dragon239 (author)2013-09-29

where do you think i should add the alarm code to in this locker code:
title Folder Private
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST Private goto MDLOCKER
echo Are you sure you want to lock the folder(Y/N)
set/p "cho=>"
if %cho%==Y goto LOCK
if %cho%==y goto LOCK
if %cho%==n goto END
if %cho%==N goto END
echo Invalid choice.
ren Private "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
echo Folder locked
goto End
echo Enter password to unlock folder
set/p "pass=>"
if NOT %pass%== 345742 goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Private
echo Folder Unlocked successfully
goto End
echo Invalid password
goto end
md Private
echo Private created successfully
goto End

dragon239 (author)2013-09-29

how do i add the alarm batch file to my Locker batch file?

shotgunshane (author)2013-03-05

it didn't work, can you help me

mikroskeem (author)2012-04-29

you can use ctrl+G too!

si13ntsl4y3r (author)2010-10-31

I clicked on your link and got this:

@echo off
color fa
title password required
set tries=4
set /a tries=%tries%-1
if %tries% equ 0 (goto penalty)
echo you have %tries% attempts left.
echo please enter password
set /p password=
if %password%==boom (start
goto top

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

thillryan (author)si13ntsl4y3r2011-12-29

Heres the code you wanted

@echo off
color fa
title password required
set tries=4
if exist pass.bat goto top
goto passme
set /p pass=Enter Password:
echo set pass=%pass%>pass.bat
goto top
set /a tries=%tries%-1
if %tries% equ 0 (goto penalty)
echo you have %tries% attempts left.
set /p password=Please Enter Password:
call pass.bat
if %password%==%pass%(goto start
goto good
echo Password Right

knexinglemon (author)2011-06-24


jmarri (author)2011-04-23

It dosen't work!!! all it says is "   "" is not recognized as a internal or external command... etc."

jklujm (author)2011-01-01

I NEED to know how to exit this thing!

Super_Nerd (author)jklujm2011-02-05

press ctrl + c and then close the cmd window

legokid101 (author)2010-12-23

you just close cmd. that works for me!

si13ntsl4y3r (author)2010-10-30

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.

Arbitror (author)si13ntsl4y3r2010-10-30

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.

cnis (author)2010-07-04

good for you i got it thanks kidu

Alex Deaton (author)2010-03-07

Hey dude thanks for posting this i used your program to create a timer batch command!! i thing i might make a instructable for it ill give u credit for the alarm.

Vraniinho (author)2010-02-18

I did all what u said... And I cant close it when I opet it... But im not hearing any beeping :S Why's that?

Arbitror (author)Vraniinho2010-02-18

You shouldn't be able to close it. You might have your internal speaker disabled in the bios.

lunchboxslayer27 (author)2008-05-18

how do u shut it off if u make it yourself? im not gonna make it till i no!!

chaster (author)lunchboxslayer272008-06-20

u can just exit it like any old window

Arbitror (author)chaster2008-06-22

If you convert it to exe, u cant.

chaster (author)Arbitror2009-12-05

right, except its not an exe...

lunchboxslayer27 (author)chaster2008-06-21

cool! thanx

Restart Computer.

like, if u turn down ur speakers, will it go away?

fwjs28 (author)lunchboxslayer272008-05-26

it comes from the internal speaker......

BlackHoleMan (author)2009-10-03

I tried this, it's pretty cool, but I can't close the window or stop the beeping!

Arbitror (author)BlackHoleMan2009-10-03

That's the point, it's an alarm. ; )
(Try turning off a car alarm when you're the burglar!)

sharlston (author)Arbitror2009-10-12

so how do you get it off?

Arbitror (author)sharlston2009-10-12

Well, read the rest of the comments and you might learn how.

li789 (author)2009-09-05

how come it shows up note pad with @echo and a dot?

kroq-gar78 (author)2009-08-16

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

Arbitror (author)2009-08-08

Yes, it does. The "desktop" is really %userprofile%\desktop. Most Command Prompts start in %userprofile%, so "cd desktop" changes the directory to %userprofile%\desktop.

Arbitror (author)2009-06-23

Uh, why? Are you a spambot?

XOIIO (author)2009-04-29

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.

r0ck3t3r (author)2009-05-23

I saw the same thing on, and I think it was a little more clearly explained.

Arbitror (author)r0ck3t3r2009-06-09

Umm... That's a dead link...

Kago (author)2009-03-29

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

Arbitror (author)Kago2009-04-26

Almost every mobo has an internal speaker, but mostly it's disabled in the BIOS settings.

Arbitror (author)Arbitror2009-06-09

My brand new Gateway computer doesn't have one, but it has everything else!

r0ck3t3r (author)2009-05-23

Here is another guide to building a batch alarm clock if anyone is having trouble with this one.

Arbitror (author)r0ck3t3r2009-05-23

It's not the alarm part that people are confused with, it's the password.

duct tape (author)2009-04-25
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:

@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

This way even if they don't put an exit command in the correct loop it doesn't sound the alarm.
MasterMediaXD (author)2008-11-02

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!

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 HorizonMy AquariumOcean Storm Oil Painting
Add instructable to: