Keywords: beep
Question:
Is there a way to send a "Beep" to my PC speaker?
Method 1:
sndrec32 /play /close "C:\Windows\Media\Notify.wav
Method 2:
To cause a batch file to beep for attention, you need to send a BEL character.
Note: this question is specifically directed to the internal PC Speaker, not the normal multimedia soundcards and speakers on modern equipment. For those, the built in WinBatch BEEP command will cause a beep....
Answer:
You can write a DOS batch file that beeps by doing the following- at the DOS prompt type:
Command Prompt:
cmd> echo FOR /L %%G IN (1,1,10) DO @echo (alt-7) > beep.bat
but instead of typing the characters: "(Alt-7)", you hold down the Alt key and press 7 on the numeric keypad.
Don't use the 7 on the qwerty part of the keyboard, it has to be on the keypad, and Num Lock has to be on.
The effect of this is to output the characters:"@echo " followed by a non-ASCII character with a decimal value of 7, into a new file called beep.bat
If you put beep.bat in a directory on your PATH, you can make your winbatch files beep by adding:
RunIcon("beep.bat","")
to your *.wbt file.
You'll probably want to set the properties for the beep.bat DOS window to close on exit too.
To cause a batch file to beep for attention, you need to send a BEL character.
The easies way to do this is to open a CMD prompt and CD to a folder in your path. Then type:
edit bell.bat
@echo
NOTE: <> indicates that you type the key(s) within the <>.
CONTROL CHARACTERS
Decimal Hexadecimal Character Mnemonic
00 00 NUL ^@
01 01 SOH ^A
02 02 STX ^B
03 03 ETX ^C
04 04 EOT ^D
05 05 ENQ ^E
06 06 ACK ^F
07 07 BEL ^G
08 08 BS ^H
09 09 HT ^I
10 0A LF ^J
11 0B VT ^K
12 0C FF ^L
13 0D CR ^M
14 0E SO ^N
15 0F SI ^O
16 10 DLE ^P
17 11 DC1 ^Q
18 12 DC2 ^R
19 13 DC3 ^S
20 14 DC4 ^T
21 15 NAK ^U
22 16 ETB ^W
23 17 SYN ^V
24 18 CAN ^X
25 19 EM ^Y
26 1A SUB ^Z
27 1B ESC ^[
28 1C FS ^\
29 1D GS ^]
30 1E RS ^^
31 1F US ^_
No comments:
Post a Comment