Skip to content

Commit 39acc22

Browse files
authored
Update README.md
Write full README
1 parent 38ce338 commit 39acc22

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

README.md

+36
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,38 @@
11
# Auto-Hibernate
22
Simple script to automatically hibernate your Windows computer (without asking) at a specified time
3+
4+
# Why?
5+
6+
Since I sometimes stay on my computer way too late, I find it very helpful to force myself off of my computer at a certain time. Having my computer shut itself down automatically forces me to wrap up before the deadline. If I forget, it'll turn off right in my face.
7+
It's also helpful for when I go off my computer but forget to shut it down. It's very nice to not have to worry about shutting it down.
8+
9+
# Requirents
10+
11+
- Windows
12+
- GCC C++ Compiler (in PATH)
13+
14+
# Usage
15+
16+
1. Download [AutoHibernate.cpp](https://github.com/HorridModz/Auto-Hibernate/blob/main/AutoHibernate.cpp)
17+
2. Open the file into a text editor, such as Notepad
18+
3. Change hibernate hour and minute (military time)
19+
4. Open a command line (such as cmd or Powershell) and cd to the directory you have downloaded the script to
20+
5. Compile the script to an exe with this command:
21+
```sh
22+
g++ -o AutoHibernate.exe AutoHibernate.cpp -mwindows -lPowrprof
23+
```
24+
6. Navigate to the created exe file in your file explorer (it will be placed in the same directory as the C++ file)
25+
7. Create a shortcut to this exe file, and place it in your startup folder (`C:\Users\%User%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup`)
26+
27+
The script will automatically start itself next time you restart your computer.
28+
29+
**Disclaimer**: Your antivirus may scan the exe file. Allow it to scan, and feel free to put it into [Virustotal](https://www.virustotal.com).
30+
31+
# How to cancel it
32+
33+
If you need to stay on your computer late, you can cancel the script using this command:
34+
```sh
35+
taskkill /F /IM AutoHibernate.exe
36+
```
37+
38+
However, be aware that this will keep it off until you either restart your computer or start it manually by double-clicking the exe file.

0 commit comments

Comments
 (0)