
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