Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hibernate/Sleep Shutdown process following the full timer means Windows can't be restarted again (tries to repeat shutdown) #123

Open
g-cranston opened this issue Feb 2, 2022 · 0 comments

Comments

@g-cranston
Copy link

g-cranston commented Feb 2, 2022

If Shutdown is set to occur via a timer delay, and this is allowed to run all the way to zero to activate Shutdown, where type of shutdown is either hibernate or sleep: then when the computer restarts to login screen, it immediately performs the same shut down again, causing a loop which is impossible to escape. (Have to reboot to safe mode).

I get the Windows 10 login screen for about 1-2 seconds, before it goes back into hibernation, so not enough time to get in and stop it. I assume the shutdown timer window is still trying to complete it's shutdown request, or is retrying it again - I think I managed to log in quickly once and saw the timer screen still there/doing its thing. This issue doesn't happen if 'Immediate stop action' is selected, or if you click the 'Immediate Shutdown' button on the shutdown timer window.

In Private Sub Shutdown_Timer_Tick, there is only one line after the Shutdown command:

        WinNUT.Shutdown_Action()
        Run_Timer.Enabled = False

I have expanded the commands after the Shutdown command, and it seems to work for me in every situation I try now. I am not sure if this is the best/appropriate coding to actually change, but works for me, and will reactivate on next power loss. I can log back in after restart, and WinNut is still running normally with no sign of the timer process that seems to be causing the problem.

    Private Sub Shutdown_Timer_Tick(sender As Object, e As EventArgs)
        Shutdown_PBar.Value = 100
        System.Threading.Thread.Sleep(1000)
        WinNUT.Shutdown_Action()
        Run_Timer.Enabled = False
        Me.Shutdown_Timer.Stop()   'GC
        Me.Shutdown_Timer.Enabled = False   'GC
        Me.Grace_Timer.Stop()   'GC
        Me.Grace_Timer.Enabled = False   'GC
        Me.Hide()   'GC
        Me.Close()   'GC
    End Sub
@g-cranston g-cranston changed the title Hibernate/Sleep Shutdown process following the full timer means Windows can't be restarted Hibernate/Sleep Shutdown process following the full timer means Windows can't be restarted again (tries to repeat shutdown) Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant