Sorry it took so long been out sick.
here is the cmd script to get the name from the network: Change the 188 to the first octect of you IP addreses, or if you want to further narrow it change that same line to include more of the for variables.
%c %d %e %f would be the entire ip address with spaces between the octets.
for /f "tokens=1-6* Delims=.: " %%a in ('ipconfig /all') do (
if "%%a %%b %%c"=="IP Address 188" (
for /f "tokens=1,2* delims=:. " %%x in ('nslookup %%c.%%d.%%e.%%f') do (
if "%%x"=="Name" wscript chgown.vbs %%y
)
)
)
And here is the VBScript (named: chgown.vbs)I used to change the name pilfered from somewhere and modified to take an argument to change the name to or prompt for one if not given.
'ChgOwnOrg.vbs - Change Win9x Registered Owner/Organization.
'Modified for Windows XP
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration",,48)
For Each objItem in colItems
strIPAddress=objItem.IPAddress(0)
arrIPAddress=split(strIPAddress,".")
objitem.DNSName
if arrIPAddress(0)="129" and arrIPAddress(1)="74" then
cj=objitem.DNSHostName
end if
next
set args = WScript.Arguments
Set ws = WScript.CreateObject("WScript.Shell")
Dim args, ws, t, p2, p3, p4, p5, n, j, h, f, k, cj
Dim itemtype,num
num=args.count
if num>0 then
cj=args.Item(0)
end if
p2 = "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\ComputerName\ComputerName\"
p3 = "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Tcpip\Parameters\"
p4 = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName\"
p5 = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\"
if num=0 and cj="" then
t = "Computer Name Change Utility"
do
cj = InputBox("Type new Computer name and click OK", t, j)
loop while cj=""
end if
If cj <> "" Then
ws.RegWrite p2 & "ComputerName", cj
ws.RegWrite p3 & "NV Hostname", cj
ws.RegWrite p4 & "ComputerName", cj
ws.RegWrite p5 & "NV Hostname", cj
End If