Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


Disable Sounds

 Keywords: disable sound sounds  

Question:

Is there a way to surpress the default sound for Message, Pause, etc. in Winbatch? I have a script that I want to run sometimes in meetings, so I would like to have a YES/NO question for audio, and be able to run the entire script without any sound if NO is selected. I've tried Intcontrol 38 and Sounds, but neither seems to do the trick.

Answer:

In current versions, WinBatch sounds are disabled by default, so it is not WinBatch making the sounds.

However when WinBatch does a message box or other display, most modern versions of windows will make one of the standard system sounds.

You would have to figure out how to disable that. Control Panel - Sounds, etc...

ideas:

I wrote a quick script that does the trick on Windows XP.

Be careful, this script modifys the registry. Its always a good idea to back up the registry before making any changes.

b=RegQueryExpsz(@REGCURRENT, "AppEvents\Schemes\Apps\.Default\.Default\.Current")
Message("Current Question Wav", b)
Answer = AskYesNo (b, "Do You want to remove it?")
If Answer == @yes then
	NewWav = ""
	GoSub SetValue
End If

Answer = AskYesNo ("Wav", "Do you want to change it back?")
If Answer == @Yes Then
	NewWav = b
	GoSub SetValue
End If

Exit

:SetValue

RegSetExpSZ(@REGCURRENT, "AppEvents\Schemes\Apps\.Default\.Default\.Current", NewWav)
c = RegQueryExpsz(@REGCURRENT, "AppEvents\Schemes\Apps\.Default\.Default\.Current")
Message("New Question Wav", c)
Return