Edit the batch/command file, add a Pause in at the end. Run it. Hopefully the window repairs open on the pause so you can see what the issue is.
Or you could run the batch/command file from a Command Line to see what the error is or what's happening.
I would suspect that if it opens/closes quickly, one of the first commands in it is incorrect and it cannot continue.