Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to change the computer name of a Windows XP or Windows Vista/7 machine from the command prompt.

So for example the command line equivalent of the following in XP. "Start >> right click My Computer >> Properties >> Computer Name tab >> Change... >> Computer Name field >> new computer name ".

Thanks James

share|improve this question
up vote 3 down vote accepted

MSKB 298593: How To Use the Netdom.exe Utility to Rename a Computer in Windows XP says this:

netdom renamecomputer machine /newname:new_computername /userd:domainname\administrator_id /passwordd:* /usero:local_admin /passwordo:* /reboot:seconds before automatic reboot

A description of the preceding command line is:

Machine is the current name of the computer.

New_computername is the name that the computer is going to have.

Domainname\administrator_id is the network basic input/output system (NetBIOS) domain name and the administrator identification (ID) of a user account that has administrative permissions to the computer object in the domain.

Local_admin is a user that has local administrative permissions, which can be the same account specified for /userd:

The asterisk symbol (*) is the value that is connected to the /passwordd: and /passwordo: parameters and specifies that the password should be typed with hidden characters when the command is submitted.

Time before automatic reboot in seconds is the amount of time before the computer restarts after renaming the computer. If this parameter is not specified, the computer must be restarted manually.

For Windows XP, you need the Support Tools included on the installation media under the Support\Tools folder. For Vista/7, netdom.exe is included by default.

share|improve this answer

This command should do just that:
netdom renamecomputer CURRENTNAME /newname:NEWNAME

Just replace the words I put in caps with the current name of the machine and the name you would like it to have.

Note that you may need to reboot for the change to happen.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.