Closing applications from the command line

Associate
Joined
23 Aug 2005
Posts
87
This is probably really simple, but I googled for about 40mins and found nothing useful. Maybe im really bad a googling, who knows. Anyway, I have written a hilariously simple file to replace my winamp shortcut with this "openwinamp.cmd":

START E:\"Program Files"\Winstick\Winstick.exe

START E:\"Program Files"\Winamp\winamp.exe

Thus opening both winamp and winstick (a program i need to open with winamp to use my remote) with a single shortcut. Now I need to extend this slightly so I have a PAUSE command, then afterwards tell winamp and winstick to close, so i can close them both when im done by just pressing enter, so it would look something like:

START E:\"Program Files"\Winstick\Winstick.exe

START E:\"Program Files"\Winamp\winamp.exe

PAUSE

(close winstick)
(close winamp)

Problem is I dont know how you tell a program to close from the command line. Can anyone help?
 
And literally minutes after writing that post I discover the TASKKILL command, now my file looks like:

START E:\"Program Files"\Winstick\Winstick.exe

START E:\"Program Files"\Winamp\winamp.exe

PAUSE

TASKKILL /im winamp.exe

TASKKILL /im winstick.exe

Just wondering if taskkill safely shutsdown the application or is it akin to the "end process" thing?
 
I kind of mean instead of killing the process (TASKKILL), I'd rather send it the message that I would like it to close, so it has time to "finish up" whatever it was doing, like when you just click the x to close a program, instead of going to task manager and killing it.
 
Back
Top Bottom