Private Const EWX_SHUTDOWN As Long = 1 Private Declare Function ExitWindowsEx Lib "user32" (ByVal dwOptions As Long, ByVal dwReserved As Long) As Long
Code
'shut down the computer lngResult = ExitWindowsEx(EWX_SHUTDOWN, 0&)