Fórum Qual comando uso para reiniciar a maquina? #269579
22/02/2005
0
Qual comando uso para reiniciar a maquina? :)
Jorge_huida
Curtir tópico
+ 0
Responder
Posts
22/02/2005
Programadorjlle
PROCURE USAR A PESQUISA :P
procedure TfMain.ShutDown;
var
TokenPriv: TTokenPrivileges;
H: DWORD;
HToken: THandle;
begin
Flag := EWX_POWEROFF;
(* WIN 2000 e NT *)
if Win32Platform = VER_PLATFORM_WIN32_NT then
begin
OpenProcessToken(GetCurrentProcess, TOKEN_ADJUST_PRIVILEGES, HToken);
LookUpPrivilegeValue(nil, ´SeShutdownPrivilege´,
TokenPriv.Privileges[0].Luid);
TokenPriv.PrivilegeCount := 1;
TokenPriv.Privileges[0].Attributes := SE_PRIVILEGE_ENABLED;
H := 0;
AdjustTokenPrivileges(HToken, False, TokenPriv, 0,
PTokenPrivileges(nil)^, H);
CloseHandle(HToken);
end;
ExitWindowsEx(EWX_FORCE or EWX_POWEROFF or EWX_SHUTDOWN, 0);
end;
procedure TfMain.ShutDown;
var
TokenPriv: TTokenPrivileges;
H: DWORD;
HToken: THandle;
begin
Flag := EWX_POWEROFF;
(* WIN 2000 e NT *)
if Win32Platform = VER_PLATFORM_WIN32_NT then
begin
OpenProcessToken(GetCurrentProcess, TOKEN_ADJUST_PRIVILEGES, HToken);
LookUpPrivilegeValue(nil, ´SeShutdownPrivilege´,
TokenPriv.Privileges[0].Luid);
TokenPriv.PrivilegeCount := 1;
TokenPriv.Privileges[0].Attributes := SE_PRIVILEGE_ENABLED;
H := 0;
AdjustTokenPrivileges(HToken, False, TokenPriv, 0,
PTokenPrivileges(nil)^, H);
CloseHandle(HToken);
end;
ExitWindowsEx(EWX_FORCE or EWX_POWEROFF or EWX_SHUTDOWN, 0);
end;
Responder
Gostei + 0
22/02/2005
Jorge_huida
agora preciso de um help para o win2000 e xp :lol: :lol: :arrow: :roll:
Responder
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)