Check the Event Viewer for clues. Also, without PC details, hard to point fingers at the usual PSU or other issues.
about a week ago while playing a game, my pc restarted without warning, and began to boot back up normally. did this for a while and stopped. then yesterday it kept doing it over and over for about 3hrs straight.
it restarts itself, boots up normally, and will randomly shut off while i'm doing w.e I'm doing @ the time
I've replaced just about everything that can be replace. ran memtest for about 12hrs while i was @ work, with 0 error. checked harddrive for errors, replaced gpu/cpu/ram. still doing it.
only thing left i can think of is a prroblem with windows maybe? any suggestions? is there any way to check for issues w/ it? and if there is a prblem to i need to re-install and lose everything?

Chowhound
Comic Vine
GameFAQs
GameSpot
Giant Bomb
TechRepublic