Changing Windows hostname from command line

Ever needed to change hostname of Windows machine on remote device from cmd? Here’s a quick way to it using wmic:

wmic computersystem where name="%COMPUTERNAME%" call rename name="NEW-NAME"

The wmic tool should be available on Win XP and newer.

Leave a Reply

Your email address will not be published. Required fields are marked *