good morning,
I made a little VB app to shutdown a laptop after it has been powered on for 2 1/2 hours, and giving the user a little over 8min warning that it is about to be shutdown.
However I have nothing in place to stop the user from restarting the device once it is shutdown.
What I would like to integrate in this, is a sort of memory where if the user doesn't wait at least 30 minutes, the shutdwon will re-iniate immediatly.
May I request guidance? I included the code I did so far.
Thank you
John
Public Class Form1
Private Declare Sub Sleep Lib "kernel32" (ByVal dwmilliseconds As Long)
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'hides the form
Me.Visible = False
Sleep(9000000) '2 and 1/2 hours
Shell("cmd /c shutdown -s -t 500 -f") '8:15min
Close()
End Sub
End Class