Sign in to follow this  
Followers 0
rhiridflaidd

Dos box errors

2 posts in this topic

I'm using an autoit frontend to launch some perl scripts.

All well and good, unless a datapoint is wrong, and confuses my poor perl script and throws an error.

run ('perl perlscript.pl dataile.txt',@ScriptDir,@SW_MAXIMIZE )

Is the command I'm running.

How do I capture any error text, without catching the full stream of data that runs in the dos boxes as pretty little graphics to show progress.

The scripts can take 10 mins plus.

Ideally I'd like the dos box not to close until there is user input.

But this can't be scripted in the perl, since the error will just call an end to the script.

Share this post


Link to post
Share on other sites



Try this

i don't know if it work with perl Posted Image

#include <Constants.au3>

$_Pid = Run (' perl perlscript.pl dataile.txt', '', @SW_MAXIMIZE, $STDERR_CHILD + $STDOUT_CHILD )
Dim $_StderrRead='', $_StdoutRead=''

While ProcessExists ( $_Pid )
    $_StderrRead = StderrRead ( $_Pid )
    If Not @error And $_StderrRead <> '' Then 
        ConsoleWrite ( "STDERR read : " & $_StderrRead & @Crlf )    
    EndIf
    $_StdoutRead = StdoutRead ( $_Pid )
    If Not @error And $_StdoutRead <> '' Then 
        ConsoleWrite ( "STDOUT read : " & $_StdoutRead & @Crlf )    
    EndIf   
    Sleep ( 1 )
Wend

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

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