How to Rename a Windows Computer from Command Line

command-line-interfacewindows

How can I rename a computer from the command line?

All I can find on the net is how to rename it in a domain, but I just want to rename the computer before joining a domain.

Best Answer

You can use the Win32_ComputerSystem WMI class and invoke the rename method. You can implement the WMI call in a vbscript, or powershell or however you choose to run the process.