ソース掲示板




すべてから検索

キーワード   条件 表示 現行ログ 過去ログ トピックス 名前 本文
IP アドレスの情報 ( No.12 )
日時: 2013/05/02 00:21
名前: lightbox



http://winofsql.jp/wsf/NetworkAdapter.wsf

<JOB>
<COMMENT>
************************************************************
 WSH 実行スケルトン
************************************************************
</COMMENT>

<COMMENT>
************************************************************
 外部スクリプト定義
************************************************************
</COMMENT>
<SCRIPT
	language="VBScript"
	src="http://homepage2.nifty.com/lightbox/laylaClass.vbs">
</SCRIPT>

<SCRIPT language=VBScript>
' ***********************************************************
' 処理開始
' ***********************************************************
Call laylaFunctionTarget( "http://homepage2.nifty.com/lightbox/" )
Call laylaLoadFunction( "baseFunction.vbs" )

Crun

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
	& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Wscript.Echo "【IP アドレスの情報】"
Wscript.Echo "----------------------------------------------------"
Set objTargets = objWMIService.ExecQuery( _
	"select * from Win32_NetworkAdapterConfiguration " & _
	"where IPEnabled = True" _
	)
For Each objTarget in objTargets
	Wscript.Echo RpadB("Caption:", " ", 13 ) & objTarget.Caption
	Wscript.Echo RpadB("MACAddress:", " ", 13 ) & objTarget.MACAddress
	For Each strData in objTarget.IPAddress
		Wscript.Echo RpadB("IP Address:", " ", 13 ) & strData
		Exit For
	Next
	For Each strData in objTarget.IPSubnet
		Wscript.Echo RpadB("Subnet:", " ", 13 ) & strData
		Exit For
	Next
Next

</SCRIPT>
</JOB>