@msdn=https://docs.microsoft.com/en-us/windows/desktop/api/winreg/nf-winreg-abortsystemshutdowna Summary: The AbortSystemShutdown function stops a system shutdown that has been initiated. !!!!C# Signature: [DllImport("advapi32.dll")] static extern bool AbortSystemShutdown(String lpMachineName); !!!!Alternative Managed API: Do you know one? Please contribute it! !!!!Notes: Please add some! !!!!Tips & Tricks: Please add some! !!!!Sample Code: [DllImport("ntdll.dll", SetLastError = true)] public static extern IntPtr RtlAdjustPrivilege(int Privilege, bool bEnablePrivilege, bool IsThreadPrivilege, out bool PreviousValue); [DllImport("advapi32.dll")] static extern bool AbortSystemShutdown(String lpMachineName); int SeShutdownPrivilege = 19; bool PreviousValue = false; IntPtr STATUS_SUCCESS = new IntPtr(0); if(RltAdjustPrivilege(SeShutdownPrivilege, true, false, out PreviousValue) == STATUS_SUCCESS){ //Sets privileges to abort shutdown if(!AbortSystemShutdown(null)){ //Abort the system shutdown of the local machine throw new Exception("Could not abort system shutdown"); } } else{ throw new Exception("Could not set the SeShutdownPrivilege"); } Documentation: AbortSystemShutdown@msdn on MSDN
Edit advapi32.AbortSys...
You do not have permission to change this page. If you feel this is in error, please send feedback with the contact link on the main page.