If you mean when it logs in to your account, it shows the desktop with no icons, then reboots, this is often the result of a virus.
If you mean it gets to the OS loading screen, then reboots, it is the result of having system32 files missing, which can be the result of a virus.
If it is the second I mentioned, you wouldn't even be able to get into safe mode to system restore. In this case, I always just format my HDD completely and re-install my OS.