Wer kennt denn schon Vista.
Delphi-Quellcode:
function GetOS(const Computer: WideString): string;
var
res : DWORD;
s : string;
si : Pointer;
Major : DWORD;
Minor : DWORD;
resourcestring
rsErrorOSUnknown = 'Betriebssystem unbekannt';
begin
si := nil;
s := '';
res := NetServerGetInfo(PWideChar(Computer), 101, @si);
if res = NERR_Success then
begin
Major := PSERVER_INFO_101(si)^.sv101_version_major;
Minor := PSERVER_INFO_101(si)^.sv101_version_minor;
if (Major = 4) and (Minor = 0) then
begin
s := 'Windows NT 4.0';
end
else if (Major = 5) and (Minor = 0) then
begin
s := 'Windows 2000';
end
else if (Major = 5) and (Minor = 1) then
begin
s := 'Windows XP';
end
else if (Major = 5) and (Minor = 2) then
begin
s := 'Windows 2003 Server Family';
end
else
s := rsErrorOSUnknown;
NetApiBufferFree(si);
end
else
s := rsErrorOSUnknown;
result := s;
end;
Das müsste man hier noch irgendwie integrieren. Welche Major und Minor ID hat denn Vista?