Ending a program

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
th3w1zard1
Posts: 8
Joined: 29 May 2011 08:34

Ending a program

#1 Post by th3w1zard1 » 08 Jun 2011 12:43

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?

allal
Posts: 34
Joined: 04 Jun 2011 05:49

Re: Ending a program

#2 Post by allal » 08 Jun 2011 13:09

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

Cleptography
Posts: 287
Joined: 16 Mar 2011 19:17
Location: scriptingpros.com
Contact:

Re: Ending a program

#3 Post by Cleptography » 08 Jun 2011 14:26

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

th3w1zard1
Posts: 8
Joined: 29 May 2011 08:34

Re: Ending a program

#4 Post by th3w1zard1 » 08 Jun 2011 15:20

awesome, thank you

Post Reply