Skip to content

DrGennadius/GSimpleWinSleepPreventer

Repository files navigation

GSimpleWinSleepPreventer

A utility for preventing Windows from falling asleep.

See doc for Russian: README.RUS.md.

The utility uses SetThreadExecutionState (kernel32).

SetThreadExecutionState is used to stop the machine timing out and entering standby/switching the display device off.

Portable standalone application

Command for help:

GSimpleWinSleepPreventer.exe -h

image

You can set the several manual modes of EXECUTION_STATE:

  1. away (ES_AWAYMODE_REQUIRED)
GSimpleWinSleepPreventer.exe -es away
  1. continuous (ES_CONTINUOUS)
GSimpleWinSleepPreventer.exe -es continuous
  1. display (ES_DISPLAY_REQUIRED)
GSimpleWinSleepPreventer.exe -es display
  1. system (ES_SYSTEM_REQUIRED)
GSimpleWinSleepPreventer.exe -es system

You can use multiple modes:

GSimpleWinSleepPreventer.exe -es continuous display system

image

You can set one of the quick modes:

  1. monitor - prevent only monitor powerdown. Modes in use: ES_CONTINUOUS and ES_DISPLAY_REQUIRED.
GSimpleWinSleepPreventer.exe -m
  1. sleep - prevent Idle-to-Sleep (monitor not affected). Modes in use: ES_CONTINUOUS and ES_AWAYMODE_REQUIRED.
GSimpleWinSleepPreventer.exe -s
  1. awake - enable away mode and prevent the sleep idle time-out. Modes in use: ES_CONTINUOUS and ES_SYSTEM_REQUIRED.
GSimpleWinSleepPreventer.exe -a
  1. full - enable full prevent. Uses all modes (display, system, away) in continuous: ES_CONTINUOUS, ES_DISPLAY_REQUIRED, ES_SYSTEM_REQUIRED and ES_AWAYMODE_REQUIRED.
GSimpleWinSleepPreventer.exe -f

image