Console beep character code - wrong number?

Viewed 1925

ASCII character code 0x07 is a beep character.

Opening CMD and clicking ALT + 007 yields :

enter image description here

And when I click ENTER - I hear a beep. This is fine.

I've searched how to add a beep in the end of a batch file, and I found that this is the solution : (I'm pasting it as an image becuase SO doesn't show the round bullet after editing) :

enter image description here

This does work and does make a sound. When examined with a HEX viewer (with beyond compare) on ECHO, the round bullet is:

enter image description here

But if I manually add ALT+7 to the document , I see this:

enter image description here

Which is a 95 as a hex - and it's not a Beep. In addition, I went to the working batch file and added a new line with my ALT+7 :

enter image description here

But looking via HEX viewer :

enter image description here

Question:

I'm a bit confused. Clicking Alt+65 does yields A everywhere.

So why does the beep different and doesn't work when saved in Windows GUI?

In the console, if I click ALT+007 I get ^G (it does beep), but when I click ALT+7 I get the circle, which is not a beep:

Here are both:

enter image description here

Another interesting observation via notepad++ :

enter image description here

I think it's related to encoding, etc, but I don't understand the inconsistency.

3 Answers

To beep in a cmd file :

Solution 1

C:\>rundll32 user32.dll,MessageBeep -1

Solution 2

C:\>echo ^G>beep.txt
C:\>type beep.txt

NB : ^G is obtained by pressing Ctrl+G and you can see the character by editing beep.txt

Related