# How to make the PC speaker beep from the Windows 7 command prompt?

I'm running some lengthy video encodes using the Handbrake command line interface. After all my encodes are done, I would like to have the PC speaker beep, as I usually turn my large external speakers off.

On Linux I would install the "beep" package, but so far I haven't found such a program for Windows 7.

Edit: The question seems to have morphed into "How to make Windows 7 beep the PC speaker?", for which the answer provided by HarryMC is the most appropriate.

-
Ctrl+G>enter gets a system beep in command prompt. Multiples of Ctrl+G gets multiple beeps. –  Moab Jan 1 '11 at 15:41
@Dennis Williamson: Yes, but I'm using Windows 7 in this case. I'm mostly aware of my options as far as Linux goes. –  oKtosiTe Jan 1 '11 at 17:30
@Moab: That doesn't make the PC speaker beep, but the default sound output device. –  oKtosiTe Jan 1 '11 at 17:31
Some systems default to the PC speaker if there are no other speakers attached. –  Moab Jan 1 '11 at 18:10
@oKtosiTe Interesting. On my computer with PC speaker and 64bit 7, I hear beep from it when using ^G in CMD. –  AndrejaKo Jan 1 '11 at 19:40

It would help to know whether your Windows 7 is 64-bit or 32-bit.

The default beep is controlled by a driver under, c:\windows\system32\drivers\beep.sys. Maybe if you switched it out with a driver from XP/Vista it would increase the volume.

To see this driver you have to open device manager then click on View > Show hidden devices. Then under Non-Plug and Play Drivers you’ll see “Beep.” This is the driver that runs your beep. Right click on it then choose properties and go to the driver tab, then click on Driver Details… This shows the file version which looks like it’s been change with Windows 7. So replace it with an older version and see what happens.

1. Boot from an UBCD4WIN disc (or BartPE if you don’t have an SATA hard drive)
2. Take ownership of the “C:\Windows\System32\Drivers\Beep.sys” file and give the local “Administrators” Group “Full Control” permissions.
3. Rename “Beep.sys” to “Beep.old” (just in case)
4. Copy “Beep.sys” from an XP machine to this location.
-
The Windows 7 I'm working on is 32 bit. Will try to swap beep.sys out with the one from Windows XP. –  oKtosiTe Jan 7 '11 at 12:26
Luckily I dual boot with XP and Arch Linux, so I think I can skip over the Live CD bit. :-) –  oKtosiTe Jan 7 '11 at 12:33
That seems to do the trick! Thank you. –  oKtosiTe Jan 8 '11 at 15:57
When I tried this on 64-bit Windows 7, it resulted in the "Beep" device not working. Anyone try this on 64-bit? –  Jason Oct 29 '14 at 18:54
@Jason: Have you tried the beep.sys from a 64-bit XP/Vista? –  harrymc Oct 29 '14 at 19:16

In Windows 7, Beep was rewritten to pass the beep to the default sound device for the session. This is normally the sound card, except when run under Terminal Services, in which case the beep is rendered on the client.

(source) (An article on why) For those who can't be bothered to read: It was to reduce manufacturing cost

But if you are content with having the beep come out of your speakers a simple batch file can do it.

You can write a DOS batch file that beeps by doing the following: at the DOS prompt type:
 echo @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.

(source)

-
Sadly, I'm not content with having the beep come out of the speakers. –  oKtosiTe Jan 1 '11 at 16:14
@oKtosiTe - Then you're probably out of luck –  Nifle Jan 1 '11 at 16:23
Is there any alternative to the numpad for the Alt-7? I only have a laptop and no numpad. –  CajunLuke Jan 2 '11 at 13:58
@CajunLuke, yes, don’t use the Alt-key combo at all for ASCII control codes (1-31), just press Ctrl+G; that’s the Ctrl-key combo for BEL. –  Synetech Jun 27 '11 at 4:12
On my Win7 box, I NEED to use ALT-007, not ALT-7. –  Cameron Dec 9 '13 at 19:51

If you have python 2.x installed this line in a bat-file works

python -c "print '\7'"

-
I get "SyntaxError: invalid syntax" when I try this with Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:06:53) [MSC v.1600 64 bit (AMD64)] on win32 –  Adriaan Koster Oct 3 '13 at 11:21
Since print is a function in python 3.x, python -c "print('\7')" should work. –  Max Truxa Sep 9 '14 at 7:08

The answer of "canopee" is THE answer! (I sadly cannot upvote it, as I am a new user.) That driver he links to, is the only one getting the beep() back for windows 7 64bit.

I tried it and can confirm that it's working like a charm. You might consider downloading "buzzer.exe" from http://encode.ru/threads/383-A-command-line-tool-for-Windows-which-beeps-through-the-System-Speaker as well, which helps using the pc-speaker from commandline even more. It supports custom frequencies and repeatings.

I am not connected to waldbauer.com or encode.ru in any way, i was just searching for a solution to the missing beep, found it, and wanted to help "spread the word"!.. o)

-

This little VDD driver fixes a problem with the Windows 7 NTVDM where the PC Speaker output is not wrapped correctly.

This may be due to the fact that the functionality of the BEEP.SYS System driver was moved to the Usermode Sound Agent. For further information, see the blog of Larry Osterman.

This driver tries to fix the problem by hooking the NTVDM-Function responsible for the Beep (LazyBeep) and replaces it with our own implementation that has various options to fix the problem.

-
There was a virus in the download link on the target page!!! –  ellockie Dec 16 '13 at 13:28
Some virus scans are giving positives on the download, but due to the nature of the program these could be false positives. The source code is included, so everyone is free to check it out as well if they are unsure. –  slhck Dec 29 '13 at 10:25

Grab NirCmd and run nircmd stdbeep.

-
I'm afraid that makes the default speakers beep, not the PC speaker. –  oKtosiTe Jan 1 '11 at 16:18
Are you sure it's enabled? –  digitxp Jan 1 '11 at 17:56
@digitxp: The BIOS beep and the ability to issue beeps from the Linux console lead me to believe it is, but you raise a valid point. I will investigate. –  oKtosiTe Jan 1 '11 at 21:08
As far as I can tell, it's enabled in every possible way. –  oKtosiTe Jan 1 '11 at 21:15
I agree with oKtosiTe; nircmd plays the beep sound through the sound card, NOT the internal speaker; even in XP. From NIRCMD.CHM: Plays the standard beep of Windows. –  Synetech Jun 26 '11 at 18:56

If you turn off your external speakers, you don't use them for anything else. So you can also just disconnect them from your computer so the beep command goes through the PC speaker. No extra software or driver transplants required. You just need to remember to reconnect them afterwards.

-
Disconnecting the speakers doesn't make the sound go through the PC speaker. Windows 7 doesn't even normally address the PC speaker anymore, as has been pointed out in some of the other answers and comments. Besides, I do use them on a regular basis, just not 100% of the time. –  oKtosiTe Jan 22 '14 at 21:32
Not that it matters anymore. The PC in question has since died and I now use an ultrabook on a daily basis, which does not have a dedicated PC speaker. Instead I now use a set of desktop speakers (3.5mm) for notifications and most games and the large, wall-mounted speakers (HDMI) for music and movies. –  oKtosiTe Jan 22 '14 at 21:33