Question : Close WOWEXEC and NTVDM

Windows processes wowexec and ntvdm are started the first time a 16 Bit application is started.
They stay in memory when the application closes.
But I need them to close after closing my application, because when I start my application the second time, I get an error message of ntvdm. When I close wowexec (or ntvdm) in task manager, I can restart my application and it runs without errors.
How can I receive to close wowexec automaticly after my application is closed?

Answer : Close WOWEXEC and NTVDM

It's a good thing to ask questions. They form the way to think of the problem. I found my solution on sending the question:
Use a batch file to start the 16 BIT application

There is a "DOS" command in Windows XP (and later): TaskKill. Options:
/F force killing
/IM not PID but Name of programm
/T kill also sub-tasks (for my example wowexec.exe)
(there are much more not used here...)
Create batch file:

myprogram.exe
taskkill /F /IM ntvdm.exe /T
Random Solutions  
 
programming4us programming4us