Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
Public Const SM_CLEANBOOT = 67 ' Place this code into the command button on click event ' Press F5 and click the command button Select Case GetSystemMetrics(SM_CLEANBOOT) Case 1: MsgBox "Windows was Started in Safe Mode." Case 2: MsgBox "Windows was Started in Safe Mode with Network support." Case Else: MsgBox "Windows is running normally." End Select Start a new project and add a new module form the project menu > Project add module click open Also add a new command button to the new form Place this code into the new module below |