hi,

i have this code from megatron

and for some reason what ever option you have, even if you have jst one in the program, all the computer does is logoff,

can anyone help or come up with another solution

Option Explicit
Private Const EWX_POWEROFF = &H8
Private Const EWX_REBOOT = 2
Private Const EWX_LOGOFF = 0
Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long


Private Sub Timer2_Timer()
If Text1.Text = Label1.Caption Then
If optsd.Value = True Then
'Shut the computer off
ExitWindowsEx EWX_POWEROFF, &H8
ElseIf optr.Value = True Then
'Reboot the computer
ExitWindowsEx EWX_REBOOT, 0
ElseIf optlo.Value = True Then
'Logoff
ExitWindowsEx EWX_LOGOFF, 0
End If

End If
End Sub

Cheers

Merlin ?