I have:
Delphi-Quellcode:
// Set DNS and NetBIOS
SetComputerName(ComputerNamePhysicalDnsHostname, FHostName);
// Set NetBIOS
SetComputerName(ComputerNamePhysicalNetBIOS, FComputerName);
My SetComputerName():
Delphi-Quellcode:
function SetComputerName(const AType: TComputerNameFormat; const AName: string): Boolean;
var
Name: array[0..MAX_COMPUTERNAME_LENGTH + 1] of Char;
begin
StrPCopy(Name, AName);
Result := SetComputerNameEx(AType, Name);
end;
It seems there is some strange problem with permissions...