I had a similar issue a few years ago. I was running Windows XP and my computer would randomly restart. Right before it restarted, the taskbar would change from the XP style taskbar to the Windows 98 style taskbar. It ended up being a virus.
I had a 10 page paper due in two days and not another computer in the house, so I just did a system restore instead of running the risk of losing my paper while working on it.
Good luck with your issue.
EDIT: Also, when in high school I did some work with troubleshooting school computers. There was an issue very similar to my old issue and your issue, with it restarting and everything. The computer guy at school said all the school computers had Deep Freeze (or something with a similar name like that) on the computer, and nothing would save making the possibility of a virus extremely slim. It ended up being an Windows update was getting downloaded automatically and prompted to restart. Because of the Deep Freeze, the update wouldn't save so the whole process kept looping until he fixed it somehow.
I don't think this really applies to you much at all since I know you don't have the Deep Freeze thing, but I thought I'd share just in case something similar was happening