If the fan on the CPU is not running then that is very bad. Processors run very hot and will overheat quickly if they are not cooled. If its shutting down then its most likely a case of it over heating. You can go into the BIOS and see if you have anything set to shut off the computer at a certain temperature. This setting is to prevent the computer from being damaged from overheating. You can also let it run in the BIOS and watch the displayed temperature and see if it keeps rising or use a program like Speccy within Windows
I would get that fan replaced before using the computer again otherwise you might ruin your processor. When they go bad they will either start giving you problems in Windows with lots of errors or the computer wont boot up at all.