Re: playing a .wav file...




"Michael Bednarek" <ROT13-zo@xxxxxxxxxxxxx> wrote in message
news:9uaog1la4p3epoqa584cn2r63auf5tl7do@xxxxxxxxxx
> On Wed, 24 Aug 2005 09:58:32 +0300, Timo Salmi <ts@xxxxxxxx> wrote in
> microsoft.public.win2000.cmdprompt.admin:
>
> >Royce wrote:
> >> Is there a way to play a .wav file in a batch file, but without
> >> windows media player opening up? Just want to play the .wav file
> >> with no windows opening up or if possible not even minimized.
> >
> [snip ^G methods]
> >The Sound Recorder can be used to play a Wave Audio Sound file
> >(.WAV). For example
> > sndrec32.exe /play /close %SYSTEMROOT%\Media\tada.wav
> [snip]
>
> The OP asked for a method to play a WAV file which would not open a
> player window. I think no on-board program can do that.

WSH/VBScript can be used to run it hidden.

Set WshShell = WScript.CreateObject("WScript.Shell")
sound = """C:\path_to\My wave file.wav"""
WshShell.Run "sndrec32 /play /close " & sound, 0, true

--
Todd Vargo (double "L" to reply by email)

.



Relevant Pages

  • Re: playing a .wav file...
    ... >>> windows media player opening up? ... Just want to play the .wav file ... >>> with no windows opening up or if possible not even minimized. ...
    (microsoft.public.win2000.cmdprompt.admin)
  • Re: playing a .wav file...
    ... >> windows media player opening up? ... Just want to play the .wav file ... >> with no windows opening up or if possible not even minimized. ...
    (microsoft.public.win2000.cmdprompt.admin)
  • Re: Sound In Outlook Express
    ... protected Windows files are intact and in their original versions. ... "Steve Cochran" wrote: ... >> Wav files play fine. ... >> wav file and send the e-mail and it plays. ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: Make a .WAV file come out of the left speaker in Windows
    ... > I am writing a Python script that uses the win32all winsound package to ... > play a .wav file. ... I eventually got out ctypes and used it to access the Windows ...
    (comp.lang.python)
  • Re: Sound In Outlook Express
    ... protected Windows files are intact and in their original versions. ... > Wav files play fine. ... > wav file and send the e-mail and it plays. ... > sound comes out of the speakers just like every other sound. ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)