Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTA to screen

Status
Not open for further replies.

ajtsystems

IS-IT--Management
Jan 15, 2009
80
GB
Hi,

I have written some code but need to get the output gnerated to the actual HTA window and then incriment it as the script loops.
I have done so far the ping routine but only echoing a text box to screen, here it is:


<HTML>
<HEAD>
<HTA:Application
Border = Thick
BorderStyle = Complex
ShowInTaskBar = YES
MaximizeButton = YES
MinimizeButton = YES
>
<SCRIPT LANGUAGE="VBScript">
Sub window_onLoad
Set objDocument = self.Document
objDocument.open

'Get name of target computer from user
strComputer = InputBox("Enter the name or IP of the computer you want information from. (Enter '.' for the local computer):")

'Verify information was entered by the user and close window if there was none.
If strcomputer = "" Then Window.Close()

'Ping computer specified by user input. If the computer doesn't respond to a ping, display a message box to the user
'letting them know. Then, close window.
Set objPing = GetObject("winmgmts:{impersonationLevel=impersonate}")._
ExecQuery("select * from Win32_PingStatus where address = '"_
& strcomputer & "'")


For Each objStatus in objPing
If IsNull(objStatus.StatusCode) or objStatus.StatusCode<>0 Then
MsgBoxValue = MsgBox ("Computer " & strComputer & " cannot be reached", 65, "Computer unavailable")
window.close()
Else MsgBoxValue = MsgBox ("Computer " & strComputer & " Is Reachable", 65, "Computer Available")
End If
Next


End Sub

</SCRIPT>
</HEAD>
<BODY>
</BODY>
</HTML>

Does anyone know how I can get my output to the screen within the HTA simply to make it slightly prettier?

Thanks
 
well, without needing to add any new controls you could try

document.title = "Computer " & strComputer & " Is Reachable", 65, "Computer Available
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top