This batch command ends one or more tasks.
Taskkill /im [taskname]
@echo off Taskkill /im mspaint.exe
The above command will send a termination message to any open programs of MS Paint.