Find the Subnet Mask on NT 
Author Message
 Find the Subnet Mask on NT

Hi all,
I am trying to find the subnet mask on an NT workstation. mswinsock.winsock
does not have it, it has .localIP. At present I am pipeing ipconfig to a
file and then stripping out Subnetmask from that. Currently I am only
looking at single LAN adapters, however you can be as sure as soon as I
release this script some bright spark will produce a dual NIC'ed machine or
a Laptop with dialup adapter, that I must then cater for.

Any help much appreciated,

Regards,

Rich



Sun, 23 Dec 2001 03:00:00 GMT  
 Find the Subnet Mask on NT
I would suggest reading the registry for this.
Set WS = WScript.CreateObject("WScript.Shell")
WS.RegRead("HKLM\System\Services\EI95X1\Paraneters\TCPIP\SubnetMask")
The problem with this is 2-fold.
1. You have to figure out what the network adapter is called in the
registry, in the example it is called "EI95X1" for a 3Com 3C595. I don't
have an answer for this one yet as I am only just learning WSH.
2. If the adapter has more than one IP address, it will also have more than
one subnet mask, delimited only by a space. This is possible with NT but not
95/98.

--
Chris Stamey
-----------------

http://www.Stamey.nu
http://www.Stamey.nu/DNSConcepts.asp
http://www.Farther.com/VBAnswerNetwork
Senior Network Engineer
Windows NT Administrator
Aspiring AS400 Administrator
VB Developer
ASP and Web Developer
Got a little JavaScript under my belt too.
More to come...
-----------------
Don't make me use uppercase...
Calm down -- it's only ones and zeroes.
Hi all,
I am trying to find the subnet mask on an NT workstation. mswinsock.winsock
does not have it, it has .localIP. At present I am pipeing ipconfig to a
file and then stripping out Subnetmask from that. Currently I am only
looking at single LAN adapters, however you can be as sure as soon as I
release this script some bright spark will produce a dual NIC'ed machine or
a Laptop with dialup adapter, that I must then cater for.

Any help much appreciated,

Regards,

Rich



Tue, 19 Feb 2002 03:00:00 GMT  
 Find the Subnet Mask on NT
I would suggest reading the registry for this.
Set WS = WScript.CreateObject("WScript.Shell")
WS.RegRead("HKLM\System\Services\EI95X1\Paraneters\TCPIP\SubnetMask")
The problem with this is 2-fold.
1. You have to figure out what the network adapter is called in the
registry, in the example it is called "EI95X1" for a 3Com 3C595. I don't
have an answer for this one yet as I am only just learning WSH.
2. If the adapter has more than one IP address, it will also have more than
one subnet mask, delimited only by a space. This is possible with NT but not
95/98.

--
Chris Stamey
-----------------

http://www.Stamey.nu
http://www.Stamey.nu/DNSConcepts.asp
http://www.Farther.com/VBAnswerNetwork
Senior Network Engineer
Windows NT Administrator
Aspiring AS400 Administrator
VB Developer
ASP and Web Developer
Got a little JavaScript under my belt too.
More to come...
-----------------
Don't make me use uppercase...
Calm down -- it's only ones and zeroes.
Hi all,
I am trying to find the subnet mask on an NT workstation. mswinsock.winsock
does not have it, it has .localIP. At present I am pipeing ipconfig to a
file and then stripping out Subnetmask from that. Currently I am only
looking at single LAN adapters, however you can be as sure as soon as I
release this script some bright spark will produce a dual NIC'ed machine or
a Laptop with dialup adapter, that I must then cater for.

Any help much appreciated,

Regards,

Rich



Tue, 19 Feb 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How to change Subnet mask with NetSh?

2. Setting subnet mask a gateway with wsh

3. How can I find files with mask?

4. Finding Users in NT SAM Request

5. wscript cant find .vbs file from NT logon batch

6. wscript cant find .vbs file from NT logon batch

7. How to find the current NT directory

8. NT 4.0 find all members in all groups?

9. Where can I find WSH error code reference for NT

10. Finding NT logon server name

11. Get DHCP subnet

12. How to generate a list of hostnames in a given ip-subnet

 

 
Powered by phpBB® Forum Software