https://github.com/gershnik/keep-awake
A simple tool to keep Windows machines awake
https://github.com/gershnik/keep-awake
prevent prevention sleep-mode ssh windows
Last synced: 4 months ago
JSON representation
A simple tool to keep Windows machines awake
- Host: GitHub
- URL: https://github.com/gershnik/keep-awake
- Owner: gershnik
- License: bsd-3-clause
- Created: 2023-04-26T21:13:08.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-04-28T16:27:19.000Z (about 2 years ago)
- Last Synced: 2025-01-02T17:50:11.564Z (6 months ago)
- Topics: prevent, prevention, sleep-mode, ssh, windows
- Language: CMake
- Homepage:
- Size: 52.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Keep-Awake
This is a small tool that allows you prevent a Windows machine from sleeping/hybernating.
This is useful, for example, when connectiong to a Windows machine that is configured to sleep when not used
over SSH.Unlike other solutions to this task `keep-awake` doesn't change global computer settings and so doesn't leave
them 'orphaned' if it is abnormally terminated.## Installation
Just drop `keep-awake.exe` from [Releases](https://github.com/gershnik/keep-awake/releases) anywhere on your `%PATH%`.
## Usage
### Keep machine awake until the process is terminated
This mode is usefull when connecting over SSH. All the child processes created within SSH session
are automatically killed when the session ends. Thus, effectively this mode keeps the computer alive while
the session is active.```bat
keep-awake
... other commands ...
```### Keep machine awake for a specified period of time:
If **not** running over SSH:
```bat
keep-awake seconds-to-keep-awake
... other commands ...
```If running over SSH to prevent the process from being killed when SSH session ends you can do this:
* If your shell is CMD
```bat
powershell -Command "Invoke-WmiMethod -Path 'Win32_Process' -Name Create -ArgumentList 'path\to\keep-awake seconds-to-keep-awake'"
```* If your shell is Powershell
```powershell
Invoke-WmiMethod -Path 'Win32_Process' -Name Create -ArgumentList 'path\to\keep-awake seconds-to-keep-awake'
```## Building
Clone this repository and open its folder in Visual Studio as a CMake project.