Page 1 of 1

Ending a program

Posted: 08 Jun 2011 12:43
by th3w1zard1
Is there a way to end a program with batch? Like if I wanted a batch program to stop Windows Media Player, is this possible?

Re: Ending a program

Posted: 08 Jun 2011 13:09
by allal
that is very easy i think taskkill will kill the process of the program

example

Code: Select all

taskkill /F /IM wmplayer.exe



this code will end all media player instance

Re: Ending a program

Posted: 08 Jun 2011 14:26
by Cleptography
taskill will not work for certain process every time. Sometimes it will fail.
You can also use wmic

Code: Select all

wmic process where name="services.exe" call terminate

Re: Ending a program

Posted: 08 Jun 2011 15:20
by th3w1zard1
awesome, thank you