https://github.com/chapvic/is_reboot_needed
Checks if you need to restart Windows
https://github.com/chapvic/is_reboot_needed
admin-tool console-tool reboot reboot-needed rebooting rename-pending win32 win64 windows windows-10
Last synced: 8 days ago
JSON representation
Checks if you need to restart Windows
- Host: GitHub
- URL: https://github.com/chapvic/is_reboot_needed
- Owner: chapvic
- License: mit
- Created: 2020-10-20T14:42:51.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-01-15T19:58:40.000Z (over 5 years ago)
- Last Synced: 2025-10-05T11:43:21.549Z (7 months ago)
- Topics: admin-tool, console-tool, reboot, reboot-needed, rebooting, rename-pending, win32, win64, windows, windows-10
- Language: C
- Homepage:
- Size: 76.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Checks if you need to restart Windows
Version: 0.3.0
This utility returns a set of reboot event codes:
- Rename pending (1)
- Reboot pending (2)
- Reboot required (4)
- Notification is active (8)
Status codes of these events are defined in `is_reboot_needed.h`:
```C
#define REBOOT_STATUS_CLEAN 0UL
#define REBOOT_STATUS_RENAME_PENDING 1UL
#define REBOOT_STATUS_REBOOT_PENDING 2UL
#define REBOOT_STATUS_REBOOT_REQUIRED 4UL
#define REBOOT_STATUS_NOTIFICATION_ACTIVE 8UL /* a reboot notification is active (Windows 10) */
```
When system is not reboot needed this utility returns `REBOOT_STATUS_CLEAN` (zero value).
Set of these flags returns through the passed pointer to an `int` variable as the parameter of the `is_reboot_needed` function, that returns `boolean` value as a result if reboot is required.
### Usage
```
is_reboot_needed [options]
-a Combination of '-s', '-d' and '-f' options.
-s Show status information. This is default option.
-d List driver updates, if present.
-f List update pending files.
-n Suppress logo.
-q Suppress all messages.
-r Automatic reboot if needed with no messages.
-i Start reboot if notification is active only (Windows 10).
(used with '-r' option)
```
Warning: If you're use `-r` option and `is reboot needed` is `TRUE`, then system will be restarted immediately.
Option `-i` allow reboot only if process `MusNotifyIcon.exe` is active (works for Windows 10)
```
Note: Since version 0.3.0 a special warning will be displayed when a reboot notification detected.
The "REBOOT_STATUS_NOTIFICATION_ACTIVE" (8) flag has been added for the return code.
```
### Compile with GCC
```
gcc -O2 -Wall -s -static -ladvapi32 -o is_reboot_needed.exe is_reboot_needed.c main.c
```
### Compile with MSVC
```
cl /MT /O2 /W3 is_reboot_needed.c main.c
```