Set WshShell = WScript.CreateObject("WScript.Shell") Set WshSysEnv = WshShell.Environment("SYSTEM") Set objFSO = CreateObject("Scripting.FileSystemObject") Set WshNetwork = WScript.CreateObject("WScript.Network") 'Network Object strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set IPConfigSet = objWMIService.ExecQuery("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE") 'On error commands are a fix for script errors when a new pc runs the script for the first time. 'On Error Resume next 'On Error GoTo 0 For Each IPConfig in IPConfigSet If Not IsNull(IPConfig.IPAddress) Then For i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress) ipadds = IPConfig.IPAddress(i) WScript.Echo "ipadds = " & ipadds If Left(ipadds,2) = "10" Then CurrentIP = IPConfig.IPAddress(i) MACAddress = IPConfig.Macaddress(i) End If Next End If Next