0

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
karel
  • 5,489
  • 46
  • 45
  • 50
  • 1
    You can't hide the task from Task Manager. Find it in there and stop it. – Squashman Aug 30 '17 at 19:21
  • But... it isn't in the Task Manager?? I know I sound like a very big noob at coding, but I very well know how the task manager works. Also, is there a way to shut it down by code? Very helpful if it's in batch file code. –  Aug 30 '17 at 22:15
  • look for either the `wscript.exe` or `cscript.exe` process and stop that. VBScript usually executes as one or the other. – Dave Aug 30 '17 at 22:58
  • I JUST found that out and was about to come back here and tell yall' :D –  Aug 30 '17 at 23:02
  • Pretty much all scripting languages have a run time compiler or shell that they run under. cscript.exe, cmd.exe, bash, perl, python – Squashman Aug 31 '17 at 17:04

2 Answers2

0

Just to end up the question.


taskkill /IM wscript.exe /F

This will stop wscript.exe with full force. However, a vbs can also be executed through cscript.exe.

According to this question, it seems to be ideal to use cscript for command-line, to execute VBS. Altough both works.

0

With your keyboard, press Ctrl+alt+del , then click Task Manager.

In task manager, click on the section where it shows you the programs that are running.

Find the VBS icon: A little cube with branches.

Click on the icon, then on the End Task Button.

Kalolol
  • 1
  • 1
  • 7