Command promt randomly closing

For starters, I use EWBF’s CUDA miner 0.3.4b, although my problem doesn’t occur because of this. My problem is that the command prompt randomly closes while i’m mining. This is stopping me from mining overnight and while at school. Anyone know a fix?

if it is closing then the program is crashing, your computer is going to sleep, or is rebooting.

rebooting = type in reliability (if using windows) to see what is causing the reboot and if that is the issue
sleep = go to power settings to see if sleep mode is on
crashing = turn logging on so that if/when it happens again you can see why

install a proper OS .