Hi,
I am looking for some startup script that can detect PC's IP subnet.
Thanks in advance.
Hi,
I am looking for some startup script that can detect PC's IP subnet.
Thanks in advance.
"tree leafs" <treeleafs@newsgroup> wrote in message
news:#v2zCWC7KHA.5808@newsgroupThis code fragment uses WMI to return the PC's IP address. You can easily
> Hi,
> I am looking for some startup script that can detect PC's IP subnet.
> Thanks in advance.
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
| Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| by subnet, how to determine all ip adress(alive or not) and dnsassociated | usri | VB Script | 1 | 05 Apr 2010 |
| script to determine password expire date and send email notificati | Eero J | PowerShell | 43 | 09 Oct 2009 |
| Script to run only on a given subnet | Glenn | VB Script | 4 | 09 Feb 2009 |
| Determine if script was run from command prompt | cwhankey | VB Script | 1 | 17 Oct 2008 |
| how to determine a script location? | Jeff Jarrell | PowerShell | 6 | 01 Jun 2007 |