I am making a batch game in notepad and I was wondering how I can play the file music in the background.
I have this:
@echo off
start Music.mp3
You can also play online music like this script :
@echo off
Title Listen to the music with batch and vbscript
mode con cols=60 lines=3 & color 9E
echo.
Echo To stop the music just close this window
set "file=http://www.chocradios.ch/djbuzzradio_windows.mp3.asx"
set "vbsfile=%tmp%\%~n0.vbs"
(
echo Set Sound = CreateObject("WMPlayer.OCX.7"^)
echo Sound.URL = "%file%"
echo Sound.Controls.play
echo do while Sound.currentmedia.duration = 0
echo wscript.sleep 100
echo loop
echo wscript.sleep (int(Sound.currentmedia.duration^)+1^)*1000
)>%vbsfile%
cscript /nologo %vbsfile%