[RESOLVED] help in shut down a machine
hey people,
Somebody please help in turning off a computer...
the code is as follows....
Private Const EWX_LogOff As Long = 0
Private Const EWX_SHUTDOWN As Long = 1
Private Const EWX_REBOOT As Long = 2
Private Declare Function ExitWindowsEx Lib "user32" _
(ByVal dwOptions As Long, _
ByVal dwReserved As Long) As Long
Public Sub LogOff()
Dim llResult As Long
llResult = ExitWindowsEx(EWX_LogOff, 0&)
End Sub
Public Sub ShutDown()
Dim llResult As Long
llResult = ExitWindowsEx(EWX_SHUTDOWN, 0&)
End Sub
Public Sub Reboot()
Dim llResult As Long
llResult = ExitWindowsEx(EWX_REBOOT, 0&)
End Sub
i am able to log off the computer but not able to turn off and reboot the system. I am using visual basic 6.0 in windows Xp professional with the firewall turned off
please help its urgent
Re: help in shut down a machine
here is 1 of 53 examples of this, when I searched 'shutdown restart' @ www.pscode.com/vb
http://www.pscode.com/vb/scripts/Sho...45593&lngWId=1