Information Technology Reference
In-Depth Information
3.
Enter the new computer name in the Computer Name text box.
4.
Click OK twice, and reboot when prompted to do so.
Using a Command-Line Interface
The following command renames the local computer to the name Computer2 (change this as
appropriate for your environment):
> wmic COMPUTERSYSTEM SET Name = Computer2
Note You need to reboot the local computer for the new name to take effect.
Using the Registry
To configure an individual computer name, set the following Registry values and reboot
the server:
[HKEY_LOCAL_MACHINE\SYSTEM\Current Control Set\Control\Computername\]
"ComputerName"=REG_SZ:" <ComputerName> "
[HKEY_LOCAL_MACHINE\SYSTEM\Current Control Set\Services\Tcpip\Parameters\]
"HostName"=REG_SZ:" <ComputerName> "
[HKEY_LOCAL_MACHINE\SYSTEM\Current Control Set\Services\Tcpip\Parameters\]
"NV HostName"=REG_SZ:" <ComputerName> "
Using VBScript
This code renames the local computer to the name Computer2 .
' ------ SCRIPT CONFIGURATION ------
strComputer = "."
strNewName = "Computer2" ' Change this to fit your environment
' ------ END CONFIGURATION ---------
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colComputers = objWMIService.ExecQuery ("Select * from Win32_ComputerSystem")
For Each objComputer in colComputers
errReturn = ObjComputer.Rename(strNewName)
WScript.Echo "Computer successfully renamed"
Next
How It Works
The reasons for changing a computer's name are many and obvious—in most cases this will be
because the computer's role is changing on the network or you're moving it to another physical
location. It's usually helpful to develop a standardized naming scheme for the computers on
Search WWH ::




Custom Search