Keep your PC free from sleep and avoid logoff, with Caffeine
Caffeine is a free, simple, portable and effective program that just presses a keyboard button automatically to make your PC believe you are there and working, thus preventing sleep mode and keeping you signed in.
The program includes (very few) options, available through its icon in the system tray, and many more you can configure using a command line to run it. Most probably you won’t need these options ever, which is the reason of not appearing in the system tray interface.
Easily accessed options include enabling and disabling the main functionality, that is to prevent your PC from going to sleep, and also basic timing modes, letting you decide for how long you want the program to stay active and keep your PC awake.
The program simulates activity by pressing the F15 key, but you can change this to Shift using the command line option -useshift. Other command line options are: -startoff (starts disabled), -exitafter:x (quit after x minutes), activefor:x (becomes inactive after x minutes), -inactivefor:x (becomes active after x minutes), -allowss (allows the screensaver but not sleep), and more.