Sign in to follow this  
Followers 0
PerryRaptor

STDOUT Not Showing Everything From Console

6 posts in this topic

I'm unable to capture all of the text on the console. There is another line of text that I need.

#include <Constants.au3>
$WinXP_Firewall_ICMP_Show = "Netsh firewall show icmpsetting"
$Console = Run(@ComSpec & " /c " & $WinXP_Firewall_ICMP_Show, @SystemDir, @SW_HIDE, $STDOUT_CHILD)
$Console_Output = StdoutRead($Console)
MsgBox(0, "ICMP Status", $Console_Output)

I'm using beta +.107.

If I wrap the procedure in a While - Wend I can get the additional text; however, I only want one button press to close MsgBox(), not every line.

#include <Constants.au3>
$WinXP_Firewall_ICMP_Show = "Netsh firewall show icmpsetting"
$Console = Run(@ComSpec & " /c " & $WinXP_Firewall_ICMP_Show, @SystemDir, @SW_HIDE, $STDOUT_CHILD)
While 1
$Console_Output = StdoutRead($Console)
MsgBox(0, "ICMP Status", $Console_Output)
Wend

Ideas are welcomed...

Share this post


Link to post
Share on other sites



#include <Constants.au3>
$Console_Output = ""
$WinXP_Firewall_ICMP_Show = "Netsh firewall show icmpsetting"
$Console = Run(@ComSpec & " /c " & $WinXP_Firewall_ICMP_Show, @SystemDir, @SW_HIDE, $STDOUT_CHILD)
While 1
    $Console_Output &= StdoutRead($Console)
    If @error = -1 Then ExitLoop
Wend


MsgBox(0, "ICMP Status", $Console_Output)


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

You can always pipe the output to a temp file and parse it. No fuss, no muss. Perhaps not as elegant, but then again, you'd be done by now :o


Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Share this post


Link to post
Share on other sites

Thanks JdeB,

I've never used "&=" before...I'll have to remember that trick

Share this post


Link to post
Share on other sites

Andy,

I did try your STDOUT to Array functions. They are nice and definately good work; however, I prefer the quick and lean method considering the size of the script and all of the procedures.

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