This sounds to me like malicious activity, either automated by a virus or done by someone else.
I had a job call out about 6 months ago on a server that had something similar - only it was shutting down instead of just logging off, and it turned out that a hacker had guessed a password and managed to place a command of shutdown -s in scheduled tasks to happen every login.
I remedied this by starting in safe mode as this bypasses pretty much everything and running Microsoft/Sysinternals Autoruns followed by a complete AV scan.
Autoruns enabled me to find the task that was doing this and delete it.
However, I did a complete reinstall on the machine after backing up data (and scanning through it thoroughly) as once a machine is hacked (not just a target of a random virus), you never know what back doors are left there.
This may be easy to remove by the method I said above, and you might be able to fix it, however whether to trust the system or not again is up to you!... If you only have a few files, it may be best to do as you said and backup the data then do a reinstall.
EDIT-
I know that you said safe mode did not work for you, however my answer covers some background information from a similar problem I dealt with. Hopefully it gives some background information, but if safe mode really does not work for you, I would look at using a AV boot disk if you do not want to do a reinstall, otherwise, doing as you said and backing up your data from scratch is probably for the best.
Lastly, it is possible that this is not a virus at all, but a corrupt system file and that would explain why it is happening in safe mode as well. Because of that, a reinstall is probably for the best.