'Get MAC address 'updated by WIAPT 2554-12-29 strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colItems = objWMIService.ExecQuery ("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True") CheckOK = "" For Each objItem in colItems For i=0 to UBound(objItem.IPAddress) if not isnull(objItem.DefaultIPGateway) then CheckOK="YES" exit for end if Next if CheckOK <> "" then exit for end if Next Mac = split(objItem.MACAddress,":") 'Create new computer name like PC-AABBCCDDEEFF NewName = "PC-"+Mac(0)+Mac(1)+Mac(2)+Mac(3)+Mac(4)+Mac(5) wscript.echo NewName