Jump to content

Recommended Posts

  • Moderators
Posted

Runwait is not going to error as long as it successfully launches @ComSpec. What you're looking for is any error messages from within the command window. Here is an example of reading from the command line:

#include <Constants.au3>

$net = Run(@ComSpec & " /c defrag.exe C:\ /A", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)

While 1
    $line = StdoutRead($net)
    If @error Then ExitLoop
        If $line <> "" Then MsgBox(0, "STDOUT read:", $line)
Wend

 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Posted
1 minute ago, JLogan3o13 said:

Runwait is not going to error as long as it successfully launches @ComSpec. What you're looking for is any error messages from within the command window. Here is an example of reading from the command line:

#include <Constants.au3>

$net = Run(@ComSpec & " /c defrag.exe C:\ /A", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)

While 1
    $line = StdoutRead($net)
    If @error Then ExitLoop
        If $line <> "" Then MsgBox(0, "STDOUT read:", $line)
Wend

 

Oh I see. Because I just want make a proper application that can capture everything tho.
Since you're saying that @Comspec is not going to error as long as it launches successfully.

But anyway, thanks for your sample tho.

  • Moderators
Posted

Runwait is running the command line, so as long as that executes, the RunWait command will not error out. If you want any errors generated by what you're doing inside the command line window, you have the read the STDOUT.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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
×
×
  • Create New...