Sign in with
Sign up | Sign in
Your question

How we can change computer name using command prompt

Last response: in Windows 7
Share
January 4, 2012 4:44:07 AM

HI please share the solution how can i change my compter name using command promet or using registry keys please do need full :non: 
a b $ Windows 7
January 4, 2012 7:13:02 AM

Open up notepad, paste code below and save with VBS extension, now run.

sNewName = "put new name here"

Set oShell = CreateObject ("WSCript.shell" )

sCCS = "HKLM\SYSTEM\CurrentControlSet\"
sTcpipParamsRegPath = sCCS & "Services\Tcpip\Parameters\"
sCompNameRegPath = sCCS & "Control\ComputerName\"

With oShell
.RegDelete sTcpipParamsRegPath & "Hostname"
.RegDelete sTcpipParamsRegPath & "NV Hostname"

.RegWrite sCompNameRegPath & "ComputerName\ComputerName", sNewName
.RegWrite sCompNameRegPath & "ActiveComputerName\ComputerName", sNewName
.RegWrite sTcpipParamsRegPath & "Hostname", sNewName
.RegWrite sTcpipParamsRegPath & "NV Hostname", sNewName
End With ' oShell

MsgBox "Computer name changed, please reboot your computer"
!