From: tree leafs on 5 May 2010 03:35 Hi, I am looking for some startup script that can detect PC's IP subnet. Thanks in advance.
From: Pegasus [MVP] on 5 May 2010 04:35 "tree leafs" <treeleafs(a)hotmail.com> wrote in message news:#v2zCWC7KHA.5808(a)TK2MSFTNGP02.phx.gbl... > 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
|
Pages: 1 Prev: Microsoft Responds to the Evolution of Online Communities Next: CopyFile readonly |