http://winofsql.jp/wsf/NetworkAdapter.wsf 拡張子:txtvbswsfjsphpjavahtmlutf8sjis <JOB> <COMMENT> ************************************************************ WSH 実行スケルトン ************************************************************ </COMMENT> <COMMENT> ************************************************************ 外部スクリプト定義 ************************************************************ </COMMENT> <SCRIPT language="VBScript" src="http://lightbox.in.coocan.jp/laylaClass.vbs"> </SCRIPT> <SCRIPT language=VBScript> ' *********************************************************** ' 処理開始 ' *********************************************************** Call laylaFunctionTarget( "http://lightbox.in.coocan.jp/" ) 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>
<JOB> <COMMENT> ************************************************************ WSH 実行スケルトン ************************************************************ </COMMENT> <COMMENT> ************************************************************ 外部スクリプト定義 ************************************************************ </COMMENT> <SCRIPT language="VBScript" src="http://lightbox.in.coocan.jp/laylaClass.vbs"> </SCRIPT> <SCRIPT language=VBScript> ' *********************************************************** ' 処理開始 ' *********************************************************** Call laylaFunctionTarget( "http://lightbox.in.coocan.jp/" ) 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>