Making the program quit is going to be your problem. Windows XP has the 'TASKKILL' command:
Code:
TASKKILL [/S system [/U username [/P [password]]]]
{ [/FI filter] [/PID processid ¦ /IM imagename] } [/F] [/T]
Description:
This command line tool can be used to end one or more processes. Processes can be killed by the process id or image name.
Parameter List:
/S system Specifies the remote system to connect to.
/U (domain\)user Specifies the user context under which the command should execute.
/P (password) Specifies the password for the given user context. Prompts for input if omitted.
/F Specifies to forcefully terminate process(es).
/FI filter Displays a set of tasks that match a given criteria specified by the filter.
/PID process id Specifies the PID of the process that has to be terminated.
/IM image name Specifies the image name of the process that has to be terminated. Wildcard '*' can be used to specify all image names.
/T Tree kill: terminates the specified process and any child processes which were started by it.
/? Displays this help/usage.
So you could go with something like that. Alternatively the Windows Scripting Host could help.