Created
March 19, 2016 16:33
-
-
Save nyabla/2e4bd2a6b39e8a420e2d to your computer and use it in GitHub Desktop.
Play a music file without a window popping up.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set "example.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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment