Hello everyone. I am obviously new here and also new to scripting. I am trying to accomplish changing DNS settings according to a computer's IP Address. The DNS server search order will be changed to certain servers depending on the range of the IP Address.
How can I determine if an IP Address is within a certain range of IP Addresses in a VBScript?
If I know a range like 192.168.10.1 - 192.168.10.50
Can I grab an IP Address using VBscript, assign it to a variable and then perform some actions if that IP Address falls within that range?
Problem I am having is that I get "expected Then" because when I assign an IP Address to a variable it doesn't like anything passed the second octet of the IP Address (only allows one decimal in the value). So,
IF strIPAddress >= 192.168.10.1 And strIPAddress <= _ 192.168.10.50 THEN
do some stuff here...
Else
do some other stuff here...
End If
isn't working because it gives me the ' expected THEN ' error right at the second decimal point in the IP Address.
What am I missing ?? Any help would be greatly appreciated.
Thanks very much,
LD
How can I determine if an IP Address is within a certain range of IP Addresses in a VBScript?
If I know a range like 192.168.10.1 - 192.168.10.50
Can I grab an IP Address using VBscript, assign it to a variable and then perform some actions if that IP Address falls within that range?
Problem I am having is that I get "expected Then" because when I assign an IP Address to a variable it doesn't like anything passed the second octet of the IP Address (only allows one decimal in the value). So,
IF strIPAddress >= 192.168.10.1 And strIPAddress <= _ 192.168.10.50 THEN
do some stuff here...
Else
do some other stuff here...
End If
isn't working because it gives me the ' expected THEN ' error right at the second decimal point in the IP Address.
What am I missing ?? Any help would be greatly appreciated.
Thanks very much,
LD