bisdhcp = WshShell.RegRead (Stcpipregkey & "EnableDHCP")
If bisdhcp Then
Gateway = WshShell.RegRead (Stcpipregkey & "DhcpDefaultGateway")
IPAddress = WshShell.RegRead (Stcpipregkey & "DhcpIPAddress")
SubnetMask = WshShell.RegRead (Stcpipregkey & "Dhcpsubnetmask")
MsgBox ("DefaultGateway:" & Gateway (0) & Chr (a) & Chr (13)
& "IPAddress:" & IPAddress & Chr (a) & Chr (a) & "SubnetMask:" & SubnetMask)
Else
Gateway = WshShell.RegRead (Stcpipregkey & "DefaultGateway")
ipaddress = WshShell.RegRead (Stcpipregkey & "IPAddress")
SubnetMask = WshShell.RegRead (Stcpipregkey & "SubnetMask")
for I=0 to Ubound (IPAddress)-1
MsgBox ("DefaultGateway:" & Gateway (0) & Chr (a) & Chr (13)
& "IPAddress:" & IPAddress (i) & Chr (a) & Chr (a) & "SubnetMask:"
& SubnetMask (i))
Next
End If
End If
Description: The network configuration of the machine is stored in the registration table, under the network card items, so first must know the name of the network card. Then take the registry data, the IP address and the child
The
netmask is an array (in fact, the registry holds binary data, and VBScript helps us to convert it). Reading the registry in WSH is very simple, specific
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service