wmic computersystem where name="%computername%" rename name = newname
For example, if you want to name the computer SC1, you can use the following command:
wmic computersystem where name="%computername%" rename name = sc1
Tip
You can use the actual name of the computer in place
of %computername%; however, the name of the computer starts with a long
set of random letters and numbers after “WIN-”. For example, the
computer name might be WIN-JMGZRUP4XHF. You can view the computer name
with the command hostname.
You must reboot the system after renaming it. The next section shows you how.