When acquiring a system from another person...I always suggest that the first/best thing to do is to delete anything that was on previously...and do a clean install.
That's what I suggest to you.
As for your comment about a CD being "stuck", I guess I don't understand what you are saying.
Before you attempt a clean install, please be sure that you have the MS activation code which applies to the system.
As for what can cause a system to shutdown...any number of things can fill that role, with the four most conspicuous hardware candidates being the motherboard, the power supply, the CPU, and the hard drive.
Then there is malware, corrupted key system files, and corrupted drivers.
Weak or bad CMOS batteries also make the system do strange things.
You say "shut down"...does the system currently boot at all? If so, how far?
You mention safe mode, can you still access safe mode?
Can you get into the BIOS?
How to get into your computer's BIOS - http://www.cyberwalker.net/faqs/reinstall-...enter-BIOS.html