How to start a system “beep”, from the built-in pc speaker, using a batch file?

前端 未结 7 1224
悲&欢浪女
悲&欢浪女 2020-12-08 16:59

I have written a batch script in an interactive mode, for making some tasks.

Sometimes, These tasks takes a long time to be finished, and then the batch asks if the

7条回答
  •  难免孤独
    2020-12-08 17:39

    I think the better solution is echoing a ^G to a file from the cmd prompt and then type that file from within the script, that way you don't need to include control characteres in the batch file itself:

    C:\> echo ^G>beep.snd
    

    Now there's an ASCII 007 char in the "beep.snd" file, then from your .bat file all you have to do is type it or copy to the screen:

    type beep.snd
    

    or

    copy beep.snd con > nul
    

提交回复
热议问题