I agree with most of the already stated, but that is only the OS(operating system) i.e. Window XP,Vista or Windows 7.
Always do the easiest and simplest diagnostics 1st.
1. It's true, hard drives can be an issue, but, this can be caused by the Mother Boards BIOS (basic, input, out-put system), or what most people fail to think about, is the simple 300 baht power supply.
2. On restart or reboot, black screen, before the OS appears press Delete, to access BIOS settings. Check your settings. You can also look at system settings, in control panel, click system, hardaware, and find the manufacture, got to website, check your specs, or simply open the PC, and look at the manufacturer printed on the Motherboard itself, after you power down and un-plug, of course.
3. Here in Thailand, also remember your PC is very warm, or I should say very hot. If you have a fairly new PC, your PC's BIOS will show you temperatures of the ambient temps in the case itself as well as what the processor temp is.
4. Aside from incorrect BIOS settings, because it is hotter here, your power supply is subject to failure very easily, especially with all the power surges we get, and if you have not grounded your PC.
5. The power supply is the engine of your PC, not the processor, memory or OS.
All peripherals, and software will never function correctly if you don't have a properly rated power supply to run that said.
6. If all seems good on the BIOS end, restart to the OS, then check MSCONFIG settings 1st, then check registry, only if you know how to edit the reg. If not, you can use some of the reg fix softwares.
7. If you keep having shut down/restart issues, most likely it's not software, hard-drive, or bios. It's your power supply dying. This is the most common issue for many PC's, that is overlooked. Very simple, very inexpensive, and saves a lot of time, and unnecessary spending, on other non-essential issues for a mere 300-400 BHT. It's very hot here, and power supplies fail all the time.
8. Do not always think it's a software issue. Keep your PC cool as possible. It is way too hot here for PC's. Notebooks, or some say Laptops, have the worst heat issues here. Purchase and use a home PC, or a MAC if your brave.
9. Do simple searches on PC cooling, bios, config sys, power supplies, motherboards and so on. Simple google searches will go a long ways, and save you some heart ache.
10. Learn what PC you have and it's components, and it will save you all sorts of troubles.
A site to help you all,
http://computer.howstuffworks.com/bios.htm