ChooseReboot




Option Explicit
Public Declare Function GetSystemMetrics Lib "user32" _
(ByVal nIndex As Long) As Long
Public Const SM_CLEANBOOT = 67
Private Sub Command1_Click()
Select Case GetSystemMetrics(SM_CLEANBOOT)
Case 1: Label1 = "The system was started in Safe Mode."
Case 2: Label1 = "The system was started in Safe Mode with Network support."
Case Else: Label1 = "Windows is running normally."
End Select
End Sub

'The constant SM_CLEANBOOT is not documented in the VB4 or VB5 API viewers.

'Valid return values for SM_CLEANBOOT are 0 (normal), 1 and 2.











( choosereboot.html )- by Paolo Puglisi - Modifica del 17/12/2023