You really, really don't want to know...
You might want to start looking at the ExitThread API, but if you're launching from a command line batch file you'll find this doesn't actually return an error code to the batch file. Why not? Well, that's where the problems start...
thread222-255803 - which is not a solution to your problem, does provide some discussion as to the issues of interaction between a VB program and a command line console.
There are ways to solve this, but they can be very ugly...