Try something like this...
strcomputer="xxxxxxxxxxxxxxxx"
username="" ' local admin account on computer to be renamed
password=""
On Error Resume Next
Const HKEY_LOCAL_MACHINE = &H80000002
Set objLocator = CreateObject("WbemScripting.SWbemLocator")
Set objService = objLocator.ConnectServer(strComputer,
"Root\DEFAULT,username,password)
Set objRegistry = objService.Get("StdRegProv")
strKeyPath = "System\CurrentControlSet\Control\ComputerName\ComputerName"
strValueName = "ComputerName"
objRegistry.SetStringValue
HKEY_LOCAL_MACHINE,strKeyPath,strValueName,newname.value
strValueName = "ActiveComputerName"
objRegistry.SetStringValue
HKEY_LOCAL_MACHINE,strKeyPath,strValueName,newname.value
strKeyPath = "System\CurrentControlSet\Services\Tcpip\Parameters"
strValueName = "HostName"
objRegistry.SetStringValue
HKEY_LOCAL_MACHINE,strKeyPath,strValueName,newname.value
strValueName = "NV HostName"
objRegistry.SetStringValue
HKEY_LOCAL_MACHINE,strKeyPath,strValueName,newname.value
I've used something similar for a while without any problems.
Pete Forman