How to play audio file on windows from command line?

前端 未结 11 1001
臣服心动
臣服心动 2020-12-10 02:41

In Windows, is there a simple way (i.e. something you could type on a single command line) to just play a couple of .mp3 files and then exit on its own?

wmplayer, f

11条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-10 03:11

    This is what I did to do it:

    rem Replace the following path with your music file
    start C:\Users\Username\Desktop\your-music.mp3
    rem Replace 10 with how many seconds you want the player to run
    ping localhost -n 10 >nul
    taskkill /im wmplayer.exe
    

    Note this requires .mp3 to be associated with wmplayer.exe (Windows Media Player).

提交回复
热议问题