Hey there,
I advise you explore the option of instead using the
ShellExecuteEx function for such a purpose, which will allow you to gain access to the process handle of the console process you spawn.
Naturally, with that process handle, you will be able to call
TerminateProcess(HANDLE, UINT) at your own discretion.
Best of luck to you with your endeavour.
References:
http://msdn.microsoft.com/library/en-us/sh....asp?frame=true
http://msdn.microsoft.com/library/en-us/dl....asp?frame=true