Close a program with a Batch File?

xtknight

Elite Member
Oct 15, 2004
12,974
0
71
tskill notepad

That will close all open notepads.

Note: that's not a "soft" exit so it won't be asking you to save, etc.
 

xtknight

Elite Member
Oct 15, 2004
12,974
0
71
Oh, by the way:

TASKKILL /IM notepad.exe /FI "WINDOWTITLE eq untitled*"

That'll do a soft-close on every untitled notepad.

TASKKILL /F /IM notepad.exe /FI "WINDOWTITLE eq untitled*"

That'll forcefully close every untitled notepad. You can change the filter after WINDOWTITLE to match what you specifically want to close. Don't change eq though, that means equals. There is also ne (not equal to).

Also tskill and taskkill are two different programs. tskill is just a quick one.
 
Jun 4, 2005
19,723
1
0
Thanks. :)

I'm using this because on a site I "manage" there is a launcher that loads up a game on a private server. Some processes interfere with the launcher causing it to not function. This way I can have users run this batch file to close the processes that interfere.