Playing a WAV file in VBscript 
Author Message
 Playing a WAV file in VBscript

Hi,
is there a way to play WAV file from VBScript (except calling an external
program)?
Joerg


Sat, 05 Jul 2003 14:40:07 GMT  
 Playing a WAV file in VBscript
Hi
try this

Set WshShell = WScript.CreateObject( "WScript.Shell" )
WshShell.Run ("""C:\windows\media\The Microsoft Sound.wav""")

--
Tom
http://cheqsoft.com - Home of "Clipboard Express"
The free multiple storage clipboard copy and paste utility.

Quote:

> Hi,
> is there a way to play WAV file from VBscript (except calling an external
> program)?
> Joerg



Sat, 05 Jul 2003 14:45:44 GMT  
 Playing a WAV file in VBscript
Thanks Tom, this works, but it calls whatever - external - program is
associated with WAV files (in my case my big fat sound editor pops up ).
I've altered your code, so that the editor at least is minimized (I think
none of the intWindowStyles can actually hide a window):
Set WshShell = WScript.CreateObject( "WScript.Shell" )
x=WshShell.Run ("""C:\windows\media\The Microsoft Sound.wav""",2)

But it still leaves the problem, that the editor has to be closed after
playing the WAV file.
I had hoped for a kind of built-in function in VBS or Windows OS, but maybe
there isn't.
(old folks like me remember how Basic could make beautiful noises with a
BEEP command, now even that seems to be out of reach vor VBS....OK, that's
another story)
Thanks again for your quick reply,
Joerg


Quote:
> Hi
> try this
> Set WshShell = WScript.CreateObject( "WScript.Shell" )
> WshShell.Run ("""C:\windows\media\The Microsoft Sound.wav""")
> --
> Tom
> http://cheqsoft.com - Home of "Clipboard Express"
> The free multiple storage clipboard copy and paste utility.


> > Hi,
> > is there a way to play WAV file from VBscript (except calling an
external
> > program)?
> > Joerg



Sat, 05 Jul 2003 17:24:35 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. .vbs file to play a .wav if file size does not equal 0

2. Playing a .wav File from a .vbs File

3. Play wav-files in VBScript?

4. Is it possible to Play and close a wav file using Soundrec32.exe

5. Need Help Playing WAV File

6. PLaying multiple .WAV files when page loads

7. Best way to play wav-files with WSH

8. Playing WAV files

9. How to play *.WAV files

10. Delaying in Playing WAV Files with Windows Media Player 9

11. Playing .wav file using EMBED tag object

12. Create a new .wav file from an existing .wav file based on the date

 

 
Powered by phpBB® Forum Software