Einzelnen Beitrag anzeigen

WojTec

Registriert seit: 17. Mai 2007
482 Beiträge
 
Delphi XE6 Professional
 
#6

Re: Set hostname - can't write to registry

  Alt 5. Apr 2012, 19:27
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.
  Mit Zitat antworten Zitat