Delphi-Quellcode:
// ShowMessage(BoolToStr(SetComputerName('TTX'), True));
// ShowMessage(SysErrorMessage(GetLastError));
// Set computer name and host name
ShowMessage(BoolToStr(SetComputerNameEx(ComputerNamePhysicalDnsHostname, 'TTX-N'), True));
// Set computer name
ShowMessage(BoolToStr(SetComputerNameEx(ComputerNamePhysicalNetBIOS, 'TTX'), True));
I tried with Run as admin too.
On WXP is working, on W7 is not working.