关闭cmd窗口提示音

Jar*_*Par 89 windows powershell cmd.exe

有没有办法基本上使 Windows 命令外壳的 Beeping 功能静音?

我现在正在编写一个 PowerShell 脚本,它最终会在屏幕上打印几行文本。我正在解决编码逻辑中的错误。但是每次我错了,我的脚本都会在屏幕上喷出一堆随机的二进制字符,并最终导致许多烦人的哔哔声。

没有哔哔声,失败很明显:)

小智 74

Windows 命令行命令net stop beep将关闭蜂鸣声,net start beep并将打开蜂鸣声。 来源

应该注意的是,该指令在 windows 上全局停止哔哔声,而不仅仅是在 windows 命令外壳内停止。此外,当您重新启动计算机时,该服务将再次运行。

@Ady's answer will suffice. But if you want to just disable it per instance, you can always put this method into a batch file (but it's so short you can just type it) and run it.

  • anishpatel:你无法停止哔哔声! (13认同)
  • 当我尝试“net stop beep”时,出现错误“无法停止 Beep 服务。”(Windows 10)。 (11认同)
  • 不错,没想到这么简单。 (4认同)

小智 46

To control the Beep service startup from the command line, disable the service across reboots with:

C:\Windows\system32>sc config beep start= disabled
[SC] ChangeServiceConfig SUCCESS
Run Code Online (Sandbox Code Playgroud)

Re-enable with

C:\Windows\system32>sc config beep start= auto
[SC] ChangeServiceConfig SUCCESS
Run Code Online (Sandbox Code Playgroud)

Note the spacing on the sc config in the above examples, as it has specific requirements.

To do this from Powershell:

PS C:\Windows\System32> set-service beep -startuptype automatic
PS C:\Windows\System32> set-service beep -startuptype disabled
Run Code Online (Sandbox Code Playgroud)


小智 31

执行以下步骤以禁用机器的系统蜂鸣声:

  1. 右键单击我的电脑并选择管理。
  2. 展开系统工具并选择设备管理器。
  3. 从“查看”菜单中,选择“显示隐藏的设备”。
  4. 展开非即插即用驱动程序。
  5. 右键单击 Beep,然后选择属性。
  6. 选择驱动程序选项卡。
  7. 单击停止。您还可以将启动类型更改为已禁用,以便哔声服务永远不会启动。

参考:http : //windowsitpro.com/article/articleid/15508/how-do-i-stop-windows-2000-from-beeping.html

  • 我在 Windows 10 上没有“非即插即用驱动程序”。 (8认同)

小智 7

您可以从 Windows 10 的声音设置中调整两种声音:

  1. 关键停止
  2. 默认提示音

我把两者都设置为无,我很幸运能保持沉默

  • 设置 > 声音 > 声音控制面板 > 声音(选项卡) > 搜索并设置为“无”都会出现 @sReall 指向的事件,因为“默认蜂鸣声”是“关键蜂鸣声”的后备设置 (2认同)

小智 7

在我看来,您无需在新系统上禁用电脑的系统蜂鸣声即可实现此目的。

  1. 右键单击系统托盘上的扬声器图标
  2. 单击打开音量混合器
  3. 将控制台窗口主机静音(或您想要静音的应用程序)

我已经为 Windows 10 的 WSL 完成了此操作,效果很好。