Create an Alarm in Batch

by Arbitror in Circuits > Computers

99400 Views, 34 Favorites, 0 Comments

Create an Alarm in Batch

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

Capture the "Alarm"

1.jpg
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.

Open Command Prompt

1.jpg
Goto start> run, then type in cmd, then press OK

or


Goto start> All Programs> Accessories> Command Prompt

Change Directory

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

Echo, ECHO!

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

Key Combo

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

Save As Batch

6.jpg
7.jpg
8.jpg
Now Type:
>alarm.bat
">" 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.

Obtain the Character

9.jpg
10.jpg
11.jpg
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...

Delete

19.jpg
20.jpg
You can now delete the file "Alarm.bat"

Alarm Code

12.jpg
13.jpg
14.jpg
15.jpg
16.jpg
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"

Save As

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

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!

Downloads