I've seen a cfew threads that say how to play music with the play minimized when it starts with start /min
, as well as one that creates a VBS script to run the audio minimized. But no matter which way I try to get audio to run minimized, it appears on screen.
Also, if I try start /min
or start /max
I'll get the same result.
Does anyone know how I can get something to start minimized?
@echo off
set "file=track12.mp3"
( 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) >sound.vbs
start /min sound.vbs
just change track12.mp3
with the name of your audio file
To loop the same song:
@echo off
set "file=track12.mp3"
( 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) >sound.vbs
:loop
start "" /wait /min sound.vbs
goto:loop
I know that I'm a bit late, but is there a way to make this loop? As in; when the sound file is finished playing it automatically loops back to the beginning?
Just delete the last line
start /min sound.vbs
and put this ::loop start "" /wait /min sound.vbs goto:loop
and it will loop on the same song....a problem! how to stop that
a way :
Taskkill /F /IM wscript.exe