Is there a way to open a sound in VBS and without a dialogue?
This is my code...
intAnswer = _
Msgbox("Do you want to play welcome.mp3?", _
vbYesNo, "Play Song?")
If intAnswer = vbYes Then
Msgbox "Opening..."
`play %userprofile%/directory/welcome.mp3 with no dialogue`
Else
Msgbox "Not opening..."
End If
You can play MP3 files in VBScript using the Windows Media Player scripting object, WMPlayer.OCX
.
Dim oPlayer
Set oPlayer = CreateObject("WMPlayer.OCX")
' Play audio
oPlayer.URL = "C:\welcome.mp3"
oPlayer.controls.play
While oPlayer.playState <> 1 ' 1 = Stopped
WScript.Sleep 100
Wend
' Release the audio file
oPlayer.close
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With