Sign in to follow this  
Followers 0
TomTcom

Display Results of a Command

6 posts in this topic

When you pull up the cmd prompt and ping a computer you see the results. I can't figure out the proper way to go about this to see the results in a window for AutoIT such as the ttl and millisecond time as it's happening.

I have used some of the sample snippets on the site but I guess I would ultimately try to create my own network tool that has functions I want specifically and can return the results on screen.

Should I be looking into the gui functions or is there a more simple "results" or "output" window from an inputbox?

I hope I asked that correctly, given my noob status to scripting I'm not sure if I'm asking correctly.

-Tom

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I'm only aware of outputing results to a file:

run ( @ComSpec & " /c ping google.com > C:testtesting.txt 2>&1" )

then you can read from the file:

Pinging google.com [74.125.224.229] with 32 bytes of data:

Reply from 74.125.224.229: bytes=32 time=8ms TTL=51

Reply from 74.125.224.229: bytes=32 time=7ms TTL=51

Reply from 74.125.224.229: bytes=32 time=7ms TTL=51

Reply from 74.125.224.229: bytes=32 time=7ms TTL=51

Ping statistics for 74.125.224.229:

Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

Minimum = 7ms, Maximum = 8ms, Average = 7ms

Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites

Have a look at the opt_flags of function "Run". You can attach to StdOut and StdErr and access the output from AutoIt. Examples are in the help file.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

I see what you are saying. Thanks for the response. It makes me wonder then if the gui functions would be better for my goal.

Share this post


Link to post
Share on other sites

A GUI definitely makes it easier for you to present the output in a way that is easier for the user to read.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Have a look at the opt_flags of function "Run". You can attach to StdOut and StdErr and access the output from AutoIt. Examples are in the help file.

Thanks, I came across those so I'll dig deeper on them.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0