One caution... The Media Player (mplayer.exe) is probably an optional
accessories component so if you plan to use this in a script that runs other
than on your own box, you can't necessarily be sure the mplayer is
installed. The other technicque could be made dynamic by reading the
registry to find the command syntax to play a wav file.
For example, on my NT box:
HKCR\.wav\
has a default value of ===> SoundRec
HKCR\SoundRec\shell\play\command\
has a default value of ===> C:\WINNT\System32\rundll32.exe
C:\WINNT\System32\amovie.ocx,RunDll /play /close %1
You _could_ read the above registry keys and replace the %1 with the fully
qualified path to the wav file you want to play. I discovered that
path/file names with embedded spaces _don't_ need to be enclosed in quotes.
Apparently, everything that follows the switches is interpreted as a
complete file name.
Quote:
>Just as you told below;
> THEY REALLY WORKS,!
> thank a lot !!
>> This also works...
>> set s = createobject("wscript.shell")
>> s.run "mplayer.exe /play /close C:\windows\media\The Microsoft
Sound.wav",0
>> --
>> Mike Harris
>----------------------------------
> (Osamu Terao)
>URL: http://www.ilc.or.jp/~terasyu/
>-----------------------------------