Question

hta to ping like when pinging in cmd

Asked by: gecko_au2003

Been looking at win32_ping or win32_pingstatus and hta's and been playing around with it but have not gotten very far.

basically I would like 2 textual type fields ( one smaller one for myself to enter in either the ip address or hostname of the device to ping ) and then other larger textual field ) to display the output something like so

Pinging COMPUTER_NAME [127.0.0.1] with 32 bytes of data:

Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128

Ping statistics for 127.0.0.1:
              Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
              Minimum = 0ms, Maximum = 0ms, Average = 0ms

Would later on like to add other functionality like nslookup etc but obviously just want a simple ping hta for the time being.

Can someone please help

Thanks

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-06-08 at 04:48:13ID24471745
Topics

VB Script

,

Scripting Languages

,

Miscellaneous Web Development

Participating Experts
1
Points
500
Comments
21

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Backup HTA Script
    I have a vbs script that backs up the user Desktop, My Documents to there U: shared drive which works great but I dont wont all the robocopy cmd box's poping up so I would like to have it run in an hta. The goal is they double click on the icon and click run and in the text b...
  2. PsInfo from .hta
    Hi Coders! Recently, I have been using PsInfo to gather information on our computers&one at a time&. Im hoping that the power of PsInfo can be packaged into an .hta (or .vbs) that will allow me to select which switch to use (with explanation). Then a browse option ...
  3. Running a command in a hta
    Hi guys, Id like to know what you guys suggest for the following. Let's say i run the following from a command line: dsquery user -name simonha* In the above, the parameter is simonha* What Id like to do is convert this into a hta so, I have the following when I run the ...
  4. VBScript-HTA and UAC
    Hello all, i've written some HTA's based on vbscript to manage Active Directory. Some of them are implemented as "Self Service", so that a lot of user may use it. I have testing them under Windows Server 2008R2 and Windows 7 and found, that the UAC will cause proble...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: sirbountyPosted on 2009-06-08 at 05:54:53ID: 24571300

Here is a ping hta.  Adjust it according to your liking...

<HEAD>
  <TITLE>Ping Tool</TITLE>
 
  <HTA:APPLICATION ID="appPing" 
     VERSION="1.00"
     APPLICATIONNAME="Ping Tool"
     CAPTION="yes"
     MINIMIZEBUTTON="no"
     MAXIMIZEBUTTON="no"
     BORDER=dialog
     SINGLEINSTANCE="yes"
     SCROLL="no"
     SHOWINTASKBAR="yes"
     SINGLEINSTANCE="yes"
     SYSMENU="yes">
>
</HEAD>
 
<SCRIPT Language="VBScript">
 
Dim strAppName : strAppName = appPing.ApplicationName
Dim strAppVer : strAppVer = appPing.Version
Dim objShell : Set objShell = CreateObject("Wscript.Shell")
 
Sub Window_Onload
	AppName.InnerHTML= "<B>" & strAppName & "</B>"
	AppVer.InnerHTML= "<B>" & strAppVer & "</B>"
	Window.MoveTo 0, 0
	Window.ResizeTo 800,600
	txtHost.Focus()
End Sub
 
Sub PingHost(strHost)
  Dim objExec : Set objExec = objShell.Exec ("Ping " & strHost)
  Do While Not objExec.StdOut.AtEndOfStream
    strData = strData & objExec.StdOut.ReadLine & "<br />"
  Loop
  PingResults.InnerHTML = strData
  Set objExec = Nothing
End Sub
 
</SCRIPT>
 
<HTML>
<BODY STYLE="font:12 pt times;color:white;background-color:#000000;">
<DIV align="center">
 
<P><SPAN ID="AppName">Application Name</SPAN>&nbsp;<B>Version</B> <SPAN ID=AppVer>0.00</SPAN><BR>
<br />
<TABLE border="0" cellpadding="0" cellspacing="0" width="95%">
<TR>
	<TD width=100% align=left colSpan="4">
		<B>Enter host name:&nbsp;&nbsp;</B><INPUT TYPE="text" NAME="txtHost" SIZE="25" TITLE="Enter either host name or IP address to ping.">&nbsp;
		<INPUT ID="submit" CLASS="button" TYPE="button" VALUE="Locate" NAME="submit" onClick="PingHost(txtHost.Value)" TITLE="Click here to submit the request.">
	</TD>
</TR>
</TABLE>
 
<SPAN ID=PingResults></SPAN>
<P />
</DIV>
</BODY>
</HTML>

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:

Select allOpen in new window

 

by: gecko_au2003Posted on 2009-06-08 at 06:00:29ID: 24571363

Is there anyway to hide the command prompt window or to use wmi instead of piping the output from the command prompt to the hta ?

 

by: sirbountyPosted on 2009-06-08 at 06:02:46ID: 24571393

Thought you wanted the results returned from the command 'ping'?
If not, then yes, there are ways to formulate the results many different ways.
The only way I know of to suppress the command window in an hta is to have the script create a temporary output file to be read in.  A tad more complicated - but please detail precisely what direction you're wanting...wmi doesn't return the results in the format posted in your question...

 

by: gecko_au2003Posted on 2009-06-08 at 06:03:41ID: 24571406

The first one  you posted does all the pinging and then outputs the results to the hta and I was hoping to see the output in real time so after its pinged each time to get it to update the html or output in the hta whether its directly in the hta as per the innerhtml or into a text field in the hta

the same as what you would see when pinging in command prompt

 

by: gecko_au2003Posted on 2009-06-08 at 06:04:37ID: 24571421

like if you logged into a linksys or other router you get the ping and nslook up buttons and when you press them you get a html window and it will literally show you the ping results in real time so was hoping to do something similiar or the same

 

by: sirbountyPosted on 2009-06-08 at 06:39:12ID: 24571847

This version uses WMI...it's formatted to basically look like the ping.exe results, although it only tests once.

<HEAD>
  <TITLE>Ping Tool</TITLE>
 
  <HTA:APPLICATION ID="appPing" 
     VERSION="1.00"
     APPLICATIONNAME="Ping Tool"
     CAPTION="yes"
     MINIMIZEBUTTON="no"
     MAXIMIZEBUTTON="no"
     BORDER=dialog
     SINGLEINSTANCE="yes"
     SCROLL="no"
     SHOWINTASKBAR="yes"
     SINGLEINSTANCE="yes"
     SYSMENU="yes">
>
</HEAD>
 
<SCRIPT Language="VBScript">
 
Dim strAppName : strAppName = appPing.ApplicationName
Dim strAppVer : strAppVer = appPing.Version
Dim objShell : Set objShell = CreateObject("Wscript.Shell")
 
Sub Window_Onload
	AppName.InnerHTML= "<B>" & strAppName & "</B>"
	AppVer.InnerHTML= "<B>" & strAppVer & "</B>"
	Window.MoveTo 0, 0
	Window.ResizeTo 800,600
	txtHost.Focus()
End Sub
 
Sub PingHost(strHost)
 
 set objPing = GetObject("winmgmts:{impersonationLevel=impersonate}").ExecQuery _
      ("select * from Win32_PingStatus where address = '" & strHost & "'")
 
    for each objRetStatus in objPing
        if IsNull(objRetStatus.StatusCode) or objRetStatus.StatusCode<>0 then
            PingResults.InnerHTML = "Status code is " & objRetStatus.StatusCode
        else
	PingResults.InnerHTML = "Pinging " & objRetStatus.Address & " with " & objRetStatus.BufferSize & " bytes of data:<br />"
	Select Case objRetStatus.StatusCode
	  Case 0
	    PingResults.InnerHTML = PingResults.InnerHTML & "Reply from " & objRetStatus.Address & ": bytes=" & objRetStatus.BufferSize & " time:" & objRetStatus.ResponseTime & " TTL=" & objRetStatus.TimeToLive
	  Case Else
 	End Select
        end if
    next
End Sub
 
</SCRIPT>
 
<HTML>
<BODY STYLE="font:12 pt times;color:white;background-color:#000000;">
<DIV align="center">
 
<P><SPAN ID="AppName">Application Name</SPAN>&nbsp;<B>Version</B> <SPAN ID=AppVer>0.00</SPAN><BR>
<br />
<TABLE border="0" cellpadding="0" cellspacing="0" width="95%">
<TR>
	<TD width=100% align=left colSpan="4">
		<B>Enter host name:&nbsp;&nbsp;</B><INPUT TYPE="text" NAME="txtHost" SIZE="25" TITLE="Enter either host name or IP address to ping.">&nbsp;
		<INPUT ID="submit" CLASS="button" TYPE="button" VALUE="Locate" NAME="submit" onClick="PingHost(txtHost.Value)" TITLE="Click here to submit the request.">
	</TD>
</TR>
</TABLE>
 
<SPAN ID=PingResults></SPAN>
<P />
</DIV>
</BODY>
</HTML>
                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:

Select allOpen in new window

 

by: gecko_au2003Posted on 2009-06-08 at 07:22:49ID: 24572397

Is there anyway to have a text field to enter the amount of times that I want it to be repeated ?

 

by: gecko_au2003Posted on 2009-06-08 at 07:39:27ID: 24572551

Just out of curiousty is it possible to use nslookup in wmi ?

 

by: sirbountyPosted on 2009-06-09 at 07:03:58ID: 24581245

This should do it.
And yes, you could perform an nslookup command, but again with the command window, unless you scripted something temporary to hide it...

<HEAD>
  <TITLE>Ping Tool</TITLE>
 
  <HTA:APPLICATION ID="appPing" 
     VERSION="1.00"
     APPLICATIONNAME="Ping Tool"
     CAPTION="yes"
     MINIMIZEBUTTON="no"
     MAXIMIZEBUTTON="no"
     BORDER=dialog
     SINGLEINSTANCE="yes"
     SCROLL="no"
     SHOWINTASKBAR="yes"
     SINGLEINSTANCE="yes"
     SYSMENU="yes">
>
</HEAD>
 
<SCRIPT Language="VBScript">
 
Dim strAppName : strAppName = appPing.ApplicationName
Dim strAppVer : strAppVer = appPing.Version
Dim objShell : Set objShell = CreateObject("Wscript.Shell")
Dim iPing
 
Sub Window_Onload
        AppName.InnerHTML= "<B>" & strAppName & "</B>"
        AppVer.InnerHTML= "<B>" & strAppVer & "</B>"
        Window.MoveTo 0, 0
        Window.ResizeTo 800,600
        optCount.Value = 1
        iPing = 1
        txtHost.Focus()
End Sub
 
Sub PingHost(strHost)
 
 set objPing = GetObject("winmgmts:{impersonationLevel=impersonate}").ExecQuery _
      ("select * from Win32_PingStatus where address = '" & strHost & "'")
     PingResults.InnerHTML = "Pinging " & strHost & " with 32 bytes of data:<br />"
    For x = 1 to iPing 
    for each objRetStatus in objPing
        If IsNull(objRetStatus.StatusCode) or objRetStatus.StatusCode<>0 then
            PingResults.InnerHTML = "Status code is " & objRetStatus.StatusCode
        Else
          Select Case objRetStatus.StatusCode
            Case 0
              PingResults.InnerHTML = PingResults.InnerHTML & "Reply from " & objRetStatus.Address & ": bytes=" & objRetStatus.BufferSize & " time:" & objRetStatus.ResponseTime & " TTL=" & objRetStatus.TimeToLive & "<br />"
            Case Else
          End Select
        End if
   Next 'x
    Next 'for each objRetStatus
End Sub
 
Sub SetCount
  iPing = optCount.Value
End Sub
 
</SCRIPT>
 
<HTML>
<BODY STYLE="font:12 pt times;color:white;background-color:#000000;">
<DIV align="center">
 
<P><SPAN ID="AppName">Application Name</SPAN> <B>Version</B> <SPAN ID=AppVer>0.00</SPAN><BR>
<br />
<TABLE border="0" cellpadding="0" cellspacing="0" width="95%">
<TR>
        <TD width=100% align=left>
                <B>Enter host name:  </B><INPUT TYPE="text" NAME="txtHost" SIZE="25" TITLE="Enter either host name or IP address to ping."> 
                <INPUT ID="submit" CLASS="button" TYPE="button" VALUE="Locate" NAME="submit" onClick="PingHost(txtHost.Value)" TITLE="Click here to submit the request.">
               <SELECT SIZE="1" name="optCount" Title="Ping Count" onChange="SetCount">
                  <Option Value="1">1</Option>
                  <Option Value="2">2</Option>
                  <Option Value="3">3</Option>
                  <Option Value="4">4</Option>
              </SELECT>
        </TD>
        <TR><TD colSpan="2">&nbsp;</TD></TR>
</TR>
</TABLE>
 
<TABLE border=0 cellpadding=0 cellspacing=0 width="95%">
<TR><TD width=100% align=left> 
<SPAN ID=PingResults></SPAN>
</TD></TR></TABLE>
<P />
</DIV>
</BODY>
</HTML>

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:

Select allOpen in new window

 

by: gecko_au2003Posted on 2009-06-10 at 00:35:01ID: 24588711

That's the 4 but maybe am expecting too much but it seems to just show all 4 ping results at once ( is that repeating the result of the first ping the same amount of times ? ) Just asking as all of the results show up all at once as apposed to doing the 4 pings one at a time

so ping ip_address

result one does ping and once done goes to the next ping...
result two does ping and once done goes to the next ping...

etc until you get to the last one and then it shows something like so

Ping statistics for IP_ADDRESS_HERE:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

But other then that great - if you can help me with just the latter part If need more help with seperating the ping results I can ask another question as obviously you have done a lot so far.

 

by: sirbountyPosted on 2009-06-10 at 04:33:59ID: 24590124

You are correct - I rushed through it and didn't span out the for loop far enough.
Please replace this sub - it should work (still rushing, so I didn't get to test it - but let me know).

Sub PingHost(strHost)
  PingResults.InnerHTML = "Pinging " & strHost & " with 32 bytes of data:<br />"
  For x = 1 to iPing  
     set objPing = GetObject("winmgmts:{impersonationLevel=impersonate}").ExecQuery _
      ("select * from Win32_PingStatus where address = '" & strHost & "'")
      for each objRetStatus in objPing
        If IsNull(objRetStatus.StatusCode) or objRetStatus.StatusCode<>0 then
            PingResults.InnerHTML = "Status code is " & objRetStatus.StatusCode
        Else
          Select Case objRetStatus.StatusCode
            Case 0
              PingResults.InnerHTML = PingResults.InnerHTML & "Reply from " & objRetStatus.Address & ": bytes=" & objRetStatus.BufferSize & " time:" & objRetStatus.ResponseTime & " TTL=" & objRetStatus.TimeToLive & "<br />"
            Case Else
          End Select
        End if
    Next 'for each objRetStatus
   Next 'x
End Sub

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:

Select allOpen in new window

 

by: gecko_au2003Posted on 2009-06-10 at 07:14:04ID: 24591709

Done that but when I select to alter the amount of pings it buggers it up with an error message

 

by: gecko_au2003Posted on 2009-06-10 at 07:14:16ID: 24591713

and I dont get the stats at the end ie 4 sent, 4 recieved etc

 

by: sirbountyPosted on 2009-06-10 at 07:43:41ID: 24592085

I'll check it out shortly...

 

by: sirbountyPosted on 2009-06-10 at 08:31:05ID: 24592811

No luck...
It may be that the browser doesn't allow it, or that I'm simply not able to come up with a solution as you've described...  
But even trying to force it to wait a bit before recycling generates a browser error about the script taking too long - which would have an adverse effect on what you're trying to accomplish.
Some other experts might have an idea on how to accomodate this, but I don't see a way around it.  If you do choose to post a new question on that, let me know.  I'd love to see how it's resolved...

 

by: gecko_au2003Posted on 2009-06-10 at 09:39:52ID: 24593570

can't you use the pause or sleep function for about 50 ie

wscript.sleep 50

or some value and then re do the ping so before the next command in between lines 16 and 17

If you can help me achieve the end part of the output so I get the stats with regards to the

sent = 4, recieved = 4, lost = 0 etc etc

 

by: sirbountyPosted on 2009-06-10 at 09:45:54ID: 24593613

No - sleep isn't a valid function in HTAs...

 

by: gecko_au2003Posted on 2009-06-10 at 09:47:54ID: 24593629

not even in vbscript ?

 

by: sirbountyPosted on 2009-06-10 at 09:51:44ID: 24593663

Well, it's not vbscript per se...
There are methods to get around it, but I didn't find any that were working properly for what you're trying to do...

 

by: sirbountyPosted on 2009-06-10 at 09:59:34ID: 24593725

Per http://www.microsoft.com/technet/scriptcenter/resources/qanda/mar06/hey0330.mspx,

>>>Now, if youre not familiar with HTAs youre first thought will likely be, Just use Wscript.Sleep. (Incidentally, if youre not familiar with HTAs, you might want to wander over to the HTA Developers Center.) Thats a good thought, but it wont work. Why not? Thats because the Wscript object is a somewhat-unique object; for one thing, you cant actually create an instance of this object. Instead, the Wscript object is automatically provided for you any time youre running under Windows Script Host. And thats the problem right there: when youre running code within an HTA you are not running under Windows Script Host. Instead, youre running under the script host provided by Internet Explorer. Because youre not running under Windows Script Host you arent automatically given access to the Wscript object, and because you cant create the Wscript object on your own theres no way to access Wscript.Sleep. You are - in highly-technical terms - hosed.
This wouldnt be that big of a deal if Internet Explorer provided a method comparable to Wscript.Sleep; unfortunately, it doesnt. <<<

There is a work-around posted there that I didn't try yet, but the three that I did weren't producing what you're going for.  You basically want a PING replacement HTA, and I don't see how one can be created to match it specifically...not without fudging the behavior.  You may be able to 'fool' the user into thinking it's waiting X ms for each reply, but that's all it would be.  The nature of the HTA is preventing that from dynamically updating the form.  That's why I'd stated I've hit my limits with this one.  I'd be curious on the solution, if there is one, but I've got no idea how to do it...

 

by: gecko_au2003Posted on 2009-06-15 at 10:08:11ID: 24630782

Something like

Location.Reload(True)

Any updates on the hta ?

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...