I am trying to code a batch file that can play a song. Luckily I found a solution to that at Stack Overflow. I used SachaDee's method, which created a VBS file that would play my mp3 file nicely.
My only issue is that once the VBS file is opened, I can't seem to find a way to stop the music. I even tried deleting the file in mid-song, but the song will still continue.
EDIT: I found out that the way to solve this is by running the following command.
taskkill /IM wscript.exe /F
Just to end up the question.
This will stop
wscript.exe
with full force. However, avbs
can also be executed throughcscript.exe
.According to this question, it seems to be ideal to use
cscript
for command-line, to executeVBS
. Altough both works.