Restart pc

shadowraven

Registered User.
Local time
Today, 15:56
Joined
May 14, 2002
Messages
75
When some clicks on a button in my database i would like it to restart the pc i have the followinfg code but cant seem to get it to work can anyone help me please.
im using access 97

herse the code i have so far

Option Compare Database
Option Explicit

Private Sub Command0_Click()
If MsgBox("Your computer needs to be rebooted. Press OK to reboot " & _
"or Cancel to Abort.", vbOKCancel + vbQuestion, "Reboot?") = vbOK Then

Dim lngRes As Long

Private Const EWX_REBOOT As Long = 2
Private Declare Function ExitWindowsEx Lib "user32" (ByVal dwOptions As Long, ByVal dwReserved As Long) As Long

Private Sub command1_Click()
lngRes = ExitWindowsEx(EWX_REBOOT, 0&)
End Sub
Else
Exit Sub
End If
 
Reboot

Its just a curiosty question mainly. but useful to know
 

Users who are viewing this thread

Back
Top Bottom