Do you like this article? Please, rate it and write review!
Rated:
by Aspin.com users
| |
| | Top messages |
| 22.3.2003 19:18:41 | |
| 4.5.2002 9:16:43 | |
| 10.2.2005 | |
| 19.3.2005 | |
Play Beep from VBScript (ASP, command line) | Areas>ASP / ASP.Net Areas>Languages>VBScript | |
| How to Play beep sound in VBScript?
Question:
I need a VBScript that causes the system to beep through the onboard
speaker when the user clicks on a line of text. I am using this for an
intranet wep site that doesn't allow applets or any program language other
than VBScript, Javascript, HTML.
The Beep code is very simple - echo character 7 to a console. You can do it using WScript.echo,
it works with cscript command line:
Next is a short function to play more beep sounds:
Sub Beep(n)
WScript.echo replace(Space(n), " ", Chr(7))
End Sub
|
Sometimes you will need to play beep sound from an ASP page, in .hta aplication or other
application which has no Echo command. You can do it with WScript.Shell object, the Shell object let's you
also play the sound asynchronously:
Sub Beep(n,Wait)
CreateObject("WScript.Shell").Run "cmd /c @echo " & replace(Space(n), " ", Chr(7)),,Wait
End Sub
|
|
See also for 'Play Beep from VBScript (ASP, command line)' article: |
If you like this page, please include next link on your pages:
<A
Href="http://www.motobit.com/tips/detpg_beep-script/"
Title="Short VBScript functions to play sound
from wscript command line or
ASP and other script applications"
>Play Beep from VBScript (ASP, command line)</A>
|
|