A DOS window will close automatically when it is empty on a black background. At the end of a .BAT file, you should have those 2 lines:

MODE BW80
@CLS

"MODE BW80" to make sure background is black and "@CLS" to clear the screen with no echo of the command (or CLS if echo is already off).