gawindx / WinNUT-Client

This is a NUT windows client for monitoring your ups hooked up to your favorite linux server.
GNU General Public License v3.0
386 stars 70 forks source link

Hibernate and Standby do not work in Windows 10/11 #116

Open cinergi2 opened 2 years ago

cinergi2 commented 2 years ago

In WinNut.vb, the Windows SetSystemPowerState function is used to initiate Hibernation or Standby if one of these is the selected method in WinNut. This function seems to be deprecated and doesn't work in Windows 10/11. Microsoft recommends using SetSuspendState instead.

Reference: https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-setsystempowerstate

Workaround: Only select Shutdown as the shutdown method in WinNUT. This calls shutdown.exe, which works.

g-cranston commented 2 years ago

I think this post could be the answer to a previously mentioned one?

89