Windows Vista Forums

script to determine PC's IP subnet

  1. #1


    tree leafs Guest

    script to determine PC's IP subnet

    Hi,
    I am looking for some startup script that can detect PC's IP subnet.
    Thanks in advance.



      My System SpecsSystem Spec

  2. #2


    Pegasus [MVP] Guest

    Re: script to determine PC's IP subnet



    "tree leafs" <treeleafs@newsgroup> wrote in message
    news:#v2zCWC7KHA.5808@newsgroup

    > Hi,
    > I am looking for some startup script that can detect PC's IP subnet.
    > Thanks in advance.
    This code fragment uses WMI to return the PC's IP address. You can easily
    extract the subnet.

    Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
    Set colNetAdapters = objWMIService.ExecQuery _
    ("Select * from Win32_NetworkAdapterConfiguration Where IPEnabled=True")

    For Each objNetAdapter In colNetAdapters
    WScript.Echo "IP_Address=" & objNetAdapter.IPAddress(0)
    Next



      My System SpecsSystem Spec

script to determine PC's IP subnet

Similar Threads
Thread Forum
by subnet, how to determine all ip adress(alive or not) and dnsassociated
Hello, I would like to create a vbscript with the following specs. Here are the specs: When definning the subnet how to determine all IP...
VB Script
Virtual PC on a different subnet?
We have two subnets on our network. That data is 192.168.0.X and a voice 172.24.0.X. We have Cisco switches with routing between the vlans...
Virtual Server
script to determine password expire date and send email notificati
How can I use a script to determine password-expiration dates for users in a organizational unit (OU) and send an email message to accounts whose...
PowerShell
Script to run only on a given subnet
Is it possible to write a startup script that will run a program such as BGinfo only if the computer is on one of a list of specified subnets? ...
VB Script
Determine if script was run from command prompt
How can I determine in my VBScipt whether the script was run from the command prompt or from double clicking in Windows Explorer? I want to pause...
VB Script
Create a subnet in AD
Hi, i don't manage to find an exemple of creating Subnet script. It's more special than creat just simple user, it's on the configuration partition...
PowerShell
how to determine a script location?
Inside a basic .PS1 script how do I determine the location of the PS1. What i am doing is I want to locate a config file which will be located in...
PowerShell