VB Code:
  1. Private Const EWX_SHUTDOWN As Long = 1
  2. Private Declare Function ExitWindowsEx Lib "user32" (ByVal dwOptions As Long, ByVal dwReserved As Long) As Long
  3.  
  4. ' SHUT DOWN COMPUTER
  5.  
  6. lngResult = ExitWindowsEx(EWX_SHUTDOWN, 0&)