var hToken: THANDLE; Tkp: TOKEN_PRIVILEGES; Nothing: Cardinal; begin OpenProcessToken (GetCurrentProcess, TOKEN_ADJUST_PRIVILEGES or TOKEN_QUERY, hToken); LookupPrivilegeValue (nil, 'SeShutdownPrivilege', tkp.Privileges [0] .Luid); tkp.PrivilegeCount: = 1; Tkp.priVileges [0] .attributes: = se_privile_enabled; AdjustTokenPrivileg (Htoken, False, TKP, 0, NIL, NOTING); EXITWINDOWSEX (EWX_SHUTDOWN, 0) end;