Aplicatia e in delphi.Folosesc componentele wmiset pt lucru cu wmi.
O sa fac paste la codul pascal
procedure tform1.rebootafterchange(machinename:string);
begin
wmiquery1.WQL.Clear;
wmiquery1.WQL.Add('SELECT * FROM Win32_OperatingSystem' );
wmiconnection1.MachineName:=machinename;
if not radiobutton2.Checked then
begin
if domain.text<>'' then
wmiconnection1.Credentials.UserName:=domain.Text+'\'+username.Text
else
wmiconnection1.Credentials.UserName:=username.Text;
wmiconnection1.Credentials.Password:=passwd.Text;
end;
wmiconnection1.Connected:=true;
wmiquery1.Active:=true;
wmimethod1.WmiMethodName:='Reboot';
wmimethod1.WmiObjectSource:=wmiquery1;
wmimethod1.Execute;
wmiquery1.Active:=false;
wmiconnection1.Connected:=false;
end ;
Multumesc
Secolul XXI ori va fi religios ori nu va fi deloc