Sorry to you hear you are having PC problems. From the way you described it I don't think its software related. It sounds like something might be starting to go bad with a piece of hardware. If it never does it again though then it could have been something as simple as dust collected on one of your boards, something overheated, you looked at your PC cross-eyed. ~grins~
It is hard to tell though without seeing the PC but from what you said about it booting slow, shutting off and restarting. That could be the hard-drive dying out. It could also be a bad memory stick, bad card (sound, video,etc) When a piece of hardware goes bad on a PC it will start doing strange stuff. And usually the only way to figure out which piece is bad is to go through them one by one. Unless it obvious like you suddenly have no sound or no video. If you can, back up any needed data from your hard-drive just in case. That way you will not lose anything if it does goes bad.
There is another thing. If you are running Windows 7 sometimes it will fail to load your desktop upon start-up. It is a known issue without any fix but to restart your PC.
Again, if it is fine now and doesn't do it again then do not worry. Could have just been a hiccup with the system. PCs can be temperamental.
I hope everything is fine now.