Как изменить NetBios-имя компьютера?
function SetComputerName( AComputerName: string ): boolean;
var
ComputerName: array[0..MAX_COMPUTERNAME_LENGTH + 1] of Char;
begin
StrPCopy( ComputerName, AComputerName );
Result := Windows.SetComputerName( ComputerName );
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if SetComputerName( 'NewName' ) then
ShowMessage( 'Новое имя начнет использоваться после перезагрузки.' ) else
ShowMessage( 'Не удалось изменить имя.' );
end; |