So with the listed Function I should be able to compare the last Octet where by allowing me to finish the Script. Let me see I use SMS to push to the machines NT 4 and Windows 2000 maybe some Win XP machines. It checks for the IP address and Subnet Mask of the machine. Then it should convert the last Octet to a numeric value this is where I can run a math function and compare the number. After it gets that number it will perform the end result assigning the correct default gateways to the machines. Is there a speical function to get the default mask I see that IP can be obtained how about the subnet Mask ? Wouldn't this be a shorter script for class Ip addresses with a limited number of subnet Masks ?