Assuming Windows...
Go to Start> Run and type "shutdown -r" (no " marks) and click "ok". This will prevent your machine from shutting itself down while you try to solve the real problem (the virus).
Sounds good.....and when I'm done, how do I UNDO that?
Heh, you know that's the command for shut down and restart? The poster might have been sarcastic. The -a switch aborts a shutdown.
This is likely a power supply issue. The restarting is the clue. The BIOS will be in the Run state and will restart the system if set do so, which is the default power-loss setting in most systems.
The power supply can be tested by booting into BIOS and waiting to see if the computer shuts down.