Reboot/Shutdown Windows
'Add a module to your project (In the menu choose Project ->
Add Module, Then click Open)
'Add 1 CommandButton to your form (named Command1).
'When you will press the button your computer will rebooted.
'Insert this code to the module :
Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, _
ByVal dwReserved As Long) As Long
'Insert this code to your form:
Private Sub Command1_Click()
'Replace EWX_REBOOT with the following options:
'EWX_FORCEForcibly terminates processes that do not respond.
'EWX_LOGOFFTerminates processes, then logs off.
'EWX_SHUTDOWNPowers the system off, if possible.
'EWX_REBOOTReboots the system.
'EWX_SHUTDOWNShuts the system down.
ExitWindowsEx EWX_REBOOT, 0
Unload Me
End Sub