Results 1 to 5 of 5

Thread: How can I play a sound file from a Windows batch file?

  1. #1
    Join Date
    Nov 2009
    Posts
    57

    How can I play a sound file from a Windows batch file?

    Hello to all,
    I am new to this forum. I know how to create batch file. I just want to know that is it possible to play a sound file from a Windows batch file. If yes, then can anyone tell me how can I play a sound file from a Windows batch file? Please help me.
    Thanks in advanced.

  2. #2
    Join Date
    Apr 2008
    Posts
    3,526

    Re: How can I play a sound file from a Windows batch file?

    If you want to play sound file like wave file (*.WAV) from Windows batch file then you have to use following command.

    If you are using Windows 95, then use following command:
    mplayer.exe /play /close <wave file>
    For example:
    mplayer.exe /play /close c:\windows\ringtone\nokia.wav

    If you are using Windows NT, then use following command:
    mplay32.exe /play /close <wave file>
    For example:
    mplay32.exe /play /close c:\winnt\ringtone\IPL.wav

  3. #3
    Join Date
    Apr 2008
    Posts
    3,297

    Re: How can I play a sound file from a Windows batch file?

    Hey you can play a sound file from a Windows batch file by using Windows mplay32.exe or mplayer.exe file. These are included with Microsoft Windows, which is used to play Windows sound files.
    If you are using Windows 95 and 98 then you must use mplayer instead of mplay32. You can do this in the following ways.

    mplay32 /play /close c:\windows\media\chimes.wav
    In the above code I have use mplay32 as the program to play the file.

  4. #4
    Join Date
    Nov 2005
    Posts
    3,026

    Re: How can I play a sound file from a Windows batch file?

    as per my knowledge you can play a sound file from a Windows batch file using
    mplay32.exe or mplayer.exe file. Just try to understand following example.
    mplay32 /play /close "c:\windows\media\Nokia.wav"
    In the above code I have give path of sound file. This is media player is only able to play .wav, .mid, *.cda, *.avi, *.asf files. You can not play .mp3 file.

  5. #5
    Join Date
    Nov 2005
    Posts
    1,203

    Re: How can I play a sound file from a Windows batch file?

    Hey if you are want to play mp3 file from a Windows batch file, then you have to use start command. It means if you wanted to open media player that can play 'rehnas.mp3" in the batch file then you have to use following code:
    start music.mp3.
    Note: This will open your default media player.

Similar Threads

  1. Windows Batch file to output directory names and size to txt file
    By m2thearkus in forum Software Development
    Replies: 6
    Last Post: 16-07-2010, 12:04 AM
  2. Replies: 1
    Last Post: 29-06-2010, 04:33 AM
  3. Replies: 5
    Last Post: 08-10-2009, 01:09 AM
  4. Replies: 3
    Last Post: 12-03-2009, 12:56 PM
  5. How can I play a Wav file from batch/cmd script?
    By NaFula in forum Windows Vista Performance
    Replies: 3
    Last Post: 13-09-2008, 09:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •