Windows – Change windows hostname from command line

hostnamewindows

This question is related to https://stackoverflow.com/questions/54989/change-windows-hostname-from-command-line, 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