ip1 = LCase(Wscript.arguments.Item(0)) If Wscript.Arguments.Count = 1 Then qr="Select * From Win32_PingStatus where Address= '"+ip1+"'" strComputer = "." Set objWMIService = GetObject(_ "winmgmts:\\" & strComputer & "\root\cimv2") Set colPings = objWMIService.ExecQuery _ (qr) For Each objStatus in colPings If IsNull(objStatus.StatusCode) _ or objStatus.StatusCode<>0 Then WScript.Echo "No Ping "+ip1 wscript.quit(-1) Else Wscript.Echo ip1 End If Next end if url="http://"+ip1+"/info_configuration.html?tab=Status&menu=DevConfig" Set xmlhttp = CreateObject("Microsoft.XMLHTTP") xmlHTTP.Open "GET",url, false xmlHTTP.Send if (xmlhttp.Status<>200) then wscript.echo "Error server connection" else e=Len(xmlhttp.ResponseText) dim d(15) i=1 str_tdcls="<td class="+chr(34)+"itemFont"+chr(34)+">" do i=i+1 loop until (Mid(xmlhttp.ResponseText,i,8)="h3 class" Or i=e-10) c=-1 do c=c+1 do i=i+1 loop until (Mid(xmlhttp.ResponseText,i,21)=str_tdcls Or i=e-22) i=i+21 a=i do i=i+1 loop until Mid(xmlhttp.ResponseText,i,1)="<" d(c)=mid(xmlhttp.ResponseText,a,i-a) loop until c=15 t=15 if right(d(0),4)="3390" then t=14 d(1)=d(2) d(2)=UCASE(left(d(t),2)+mid(d(t),4,2)+mid(d(t),7,2)+mid(d(t),10,2)+mid(d(t),13,2)+right(d(t),2)) d(3)="Model:" +chr(9)+chr(9)+d(0) d(4)="Serial:"+chr(9)+chr(9)+d(1) d(5)="MAC:"+chr(9)+chr(9)+d(2) for i=3 to 5 wscript.echo d(i) next If Wscript.Arguments.Count=2 then if LCase(Wscript.arguments.Item(1))="f" Then Set MyFSO = CreateObject("Scripting.FileSystemObject") Set fbtL = MyFSO.CreateTextFile("C:\TEMP\set_mfu.bat", True) fbtL.WriteLine("SET HPBATmodel="+mid(d(0),13,5)) fbtL.WriteLine("SET HPBATmac="+d(2)) fbtL.WriteLine("SET HPCOMstart="+chr(34)+comstart+"\HP"+chr(34)) fbtL.Close end if end if end if |