Change Computer Name

|
Option Explicit

Set ws = WScript.CreateObject("WScript.Shell")
Dim ws, t, p1, p2, n, cn, vbdefaultbutton
Dim itemtype

p1 = "HKLMSYSTEMCurrentControlSetControlComputerNameComputerName"

n = ws.RegRead(p1 & "ComputerName")
t = "Change Computer Name"
cn = InputBox("Type new Name and click OK", t, n)
If cn <> "" Then
  ws.RegWrite p1 & "ComputerName", cn
End If
Originally Posted on July 18, 2013
Last Updated on October 26, 2015
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.