<html>
<head>
<title>Trouble Shooting Tool for Helpdesk</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head><body bgcolor="#FFFFFF">
<object classid="clsid:{72C24DD5-D70A-438B-8A42-98424B88AFB8}" id="o_shellobj"></object>
<script language="VBscript">
Sub IP()
'Option Explicit
On Error resume Next
Dim result, outPut,ip
'Set o_shellobj = CreateObject("WScript.Shell")
if(err.number<>0) Then
msgbox (Err.Description)
exit sub
End If
set result = o_shellobj.Exec("ping uk911dp6008")
if(err.number<>0) Then
msgbox (Err.Description)
exit sub
End If
outPut = ""
Do While result.StdOut.AtEndOfStream <> True
outPut = outPut + result.StdOut.ReadLine
Loop
if(err.number<>0) Then
msgbox (Err.Description)
exit sub
End If
Dim oRE, oMatches
Set oRE = New RegExp
if(err.number<>0) Then
msgbox (Err.Description)
exit sub
End If
oRE.Global = True
if(err.number<>0) Then
msgbox (Err.Description)
exit sub
End If
oRE.IgnoreCase = True
if(err.number<>0) Then
msgbox (Err.Description)
exit sub
End If
oRE.Pattern = "[0-9]+.[0-9]+.[0-9]+.[0-9]+"
if(err.number<>0) Then
msgbox (Err.Description)
exit sub
End If
set oMatches = oRE.Execute(outPut)
if(err.number<>0) Then
msgbox (Err.Description)
err.clear
exit sub
End If
Dim oMatch
For Each oMatch In oMatches
' textfield.Value = oMatch.Value '<<<<<<<<<<<<<<<<problem:i want this value to asssign to the textfield
'msgbox (oMatch.Value) ' instead of of the messagebox >>>>>>>>>>>>>>>>>>>>.
ip = oMatch.Value
Exit For
Next
if(err.number<>0) Then
msgbox(Err.Description)
msgbox"here is the prob"
exit sub
End If
End Sub
</script>
<div id="Layer1" style="position:absolute; left:207px; top:25px; width:414px; height:20px; z-index:1"></div>
<div id="Layer2" style="position:absolute; left:157px; top:55px; width:549px; height:70px; z-index:2">
<form name="form1" >
<p>Computer Name:
<input type="text" name="textfield">
<INPUT TYPE="Button" NAME="Button1" VALUE="Click">
<SCRIPT FOR="Button1" EVENT="onClick" LANGUAGE="VBScript">
call IP()
</SCRIPT>
IP Address
<input type="text" name="textfield2" >
</p>
</form>
</div>
<div id="Layer3" style="position:absolute; left:51px; top:145px; width:873px; height:17px; z-index:3">
<hr>
</div>
<div id="Layer4" style="position:absolute; left:53px; top:188px; width:881px; height:490px; z-index:4"></div>
</body>
</html>