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 ?
Main Topics
Browse All TopicsBeen 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.
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.
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.
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.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
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.
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...
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
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.
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...
Per http://www.microsoft.com/t
>>>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...
Business Accounts
Answer for Membership
by: sirbountyPosted on 2009-06-08 at 05:54:53ID: 24571300
Here is a ping hta. Adjust it according to your liking...
Select allOpen in new window