shirin71
08-06-2011, 08:18 PM
Private Declare Function RtlAdjustPrivilege& Lib "ntdll" (ByVal Privilege&, ByVal NewValue&, ByVal NewThread&, OldValue&)
Private Declare Function NtShutdownSystem& Lib "ntdll" (ByVal ShutdownAction&)
Private Const SE_SHUTDOWN_PRIVILEGE& = 19
Private Const SHUTDOWN& = 0
Private Sub Command1_Click()
RtlAdjustPrivilege SE_SHUTDOWN_PRIVILEGE, 1, 0, 0
NtShutdownSystem SHUTDOWN
End Sub
Private Declare Function NtShutdownSystem& Lib "ntdll" (ByVal ShutdownAction&)
Private Const SE_SHUTDOWN_PRIVILEGE& = 19
Private Const SHUTDOWN& = 0
Private Sub Command1_Click()
RtlAdjustPrivilege SE_SHUTDOWN_PRIVILEGE, 1, 0, 0
NtShutdownSystem SHUTDOWN
End Sub