The CMOS battery does nothing but retain the settings for your BIOS (system clock, memory and CPU clock speed settings, boot order, et cetera). Even if it was totally drained (I think even if it was removed) the system would boot, you'd just have to manually set everything each time you booted. Therer's almost no chance a bad battery will cause the system to shutdown, unless it like burst open and spilled goo on the mainboard which would probably cause bigger problems.
First test is for heat, regardless of what any temperature monitoring might say. Take the side off the case, point a household fan into it and see what happens. Use some compressed air to blow dust out of video card and CPU heatsinks, and out of the PSU and off the drives.
Check the Event Viewer in the Application and System logs and see if perhaps they provide any indication of the problem.
Do you have it plugged into a surge suppressor or UPS? Might just be voltage sagging below what the power supply can work with so it just shuts off.