Windows – Change windows hostname from command line


This question is related to, but I'm in a different situation. The netdom tool will not work on a computer not joined to a domain. I've tried setting the hostname from the registry, but I was wondering if there was another way from the command-line.

Best Answer

  • Right from the link you provided:

    wmic computersystem where name="OLDNAME" call rename name="NEWNAME"

    Then reboot with

    shutdown /r /t 0
  • Related Question