You can use the tool "Don't Sleep":
Don't Sleep is a small portable program to prevent system shutdown,
Standby, Hibernate, Turn Off and Restart.
Especially when old Programs run on Windows-7 or Windows Vista. Here's
more aggressive power-saving features with new rules.
But not only that, it also prevents loggin off the computer, and the
deactivation of the monitor or activation of the screen saver.
Of course you can also manually disable all the options and then
activate again, but with Don't Sleep one can save now many hand moves
and also save time! And it's easier than ever.
Apart from the fact Don't Sleep has a timer that allows time control
unblock, or shutdown the computer for a specified time.