{"id":31374640,"url":"https://github.com/sunsetmkt/emergencyshutdown","last_synced_at":"2025-09-28T00:34:58.597Z","repository":{"id":280753712,"uuid":"943049739","full_name":"SunsetMkt/EmergencyShutdown","owner":"SunsetMkt","description":"Emergency Shutdown for Windows.","archived":false,"fork":false,"pushed_at":"2025-03-06T02:04:34.000Z","size":34,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-24T05:49:59.414Z","etag":null,"topics":["cpp","ntdll","ntshutdownsystem","shutdown","visual-studio","windows"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SunsetMkt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-05T05:00:17.000Z","updated_at":"2025-05-16T13:27:44.000Z","dependencies_parsed_at":"2025-03-05T06:20:41.018Z","dependency_job_id":"f0f77f6c-c8bb-469c-9933-af1e8e15bfe5","html_url":"https://github.com/SunsetMkt/EmergencyShutdown","commit_stats":null,"previous_names":["sunsetmkt/emergencyshutdown"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SunsetMkt/EmergencyShutdown","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SunsetMkt%2FEmergencyShutdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SunsetMkt%2FEmergencyShutdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SunsetMkt%2FEmergencyShutdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SunsetMkt%2FEmergencyShutdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SunsetMkt","download_url":"https://codeload.github.com/SunsetMkt/EmergencyShutdown/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SunsetMkt%2FEmergencyShutdown/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277311260,"owners_count":25796890,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-27T02:00:08.978Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","ntdll","ntshutdownsystem","shutdown","visual-studio","windows"],"created_at":"2025-09-28T00:34:55.837Z","updated_at":"2025-09-28T00:34:58.593Z","avatar_url":"https://github.com/SunsetMkt.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EmergencyShutdown\n\nEmergency Shutdown for Windows.\n\n## Warning\n\nEmergency Shutdown powers off the system almost immediately without notifying other applications, which may cause instability and data loss.\n\n## Usage\n\n```plain\nUsage: EmergencyShutdown [/r | /s] [/t seconds]\n  /r : Reboot the system\n  /s : Shutdown the system\n  /t seconds : Set a countdown before executing (default 0)\nThis program will shutdown or reboot the system immediately by\ncalling the NtShutdownSystem function without notifying other\napplications, which may cause instability and data loss.\n```\n\nRename the executable to `ShutdownImmediatelyDangerously.exe` or `RebootImmediatelyDangerously.exe` and run it will shutdown or reboot the system immediately.\n\n## Background\n\n[Reference](https://www.codeproject.com/Articles/34194/Performing-emergency-shutdowns)\n\nMany of the Nt/Zw functions inside the Windows kernel are documented, but some are not. The `NtShutdownSystem` function is documented pretty well [here](http://undocumented.ntinternals.net/UserMode/Undocumented%20Functions/Hardware/NtShutdownSystem.html) at [NTInternals](http://undocumented.ntinternals.net/). The `NtSetSystemPowerState` function, however, is not.\n\nAt the final stages of the Windows shutdown process, `NtShutdownSystem` is called. It is responsible for shutting down all drivers, flushing Registry hives and the disc cache, clearing the page file, etc. After doing so, it calls the `NtSetSystemPowerState` function.\n\n`NtSetSystemPowerState` then causes all plug-and-play devices to be shut down and the system to be either halted, powered off, or rebooted.\n\nHowever, calling these two functions without notifying the system first is extremely dangerous, and may cause instability in the system.\n\nThere're reports saying that `NtSetSystemPowerState` does not work in some cases, so this program will use `NtShutdownSystem` instead.\n\n## Thanks to\n\n-   [bormaxi8080/windows-force-reboot](https://github.com/bormaxi8080/windows-force-reboot)\n-   [ChatGPT](https://chatgpt.com/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunsetmkt%2Femergencyshutdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsunsetmkt%2Femergencyshutdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunsetmkt%2Femergencyshutdown/lists"}