hi, i want to create a program which would prevent computer running in defined time period (it would shutdown)
i wrote some code but it's not working :-(
when started it has status non-responding.
Option Explicit
Dim notime As String
Dim RETVAL2 As Variant
Declare Sub Sleep Lib "kernel32" (ByVal milliseconds As Long)
Sub main()
On Error GoTo ex1
notime = Format(Time, "hhmmss")
nav1:
If notime > "000001" And notime < "060000" Then
RETVAL2 = Shell("C:\windows\system32\shutdown.exe -s -f -t 00")
End If
Sleep 60000
GoTo nav1
ex1:
MsgBox Err.Description, 16, "Error message. "
Resume Next
End Sub
any suggestion please?
i wrote some code but it's not working :-(
when started it has status non-responding.
Option Explicit
Dim notime As String
Dim RETVAL2 As Variant
Declare Sub Sleep Lib "kernel32" (ByVal milliseconds As Long)
Sub main()
On Error GoTo ex1
notime = Format(Time, "hhmmss")
nav1:
If notime > "000001" And notime < "060000" Then
RETVAL2 = Shell("C:\windows\system32\shutdown.exe -s -f -t 00")
End If
Sleep 60000
GoTo nav1
ex1:
MsgBox Err.Description, 16, "Error message. "
Resume Next
End Sub
any suggestion please?