Jump to content
Sign in to follow this  

Dos box errors

Recommended Posts


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 )    
    $_StdoutRead = StdoutRead ( $_Pid )
    If Not @error And $_StdoutRead <> '' Then 
        ConsoleWrite ( "STDOUT read : " & $_StdoutRead & @Crlf )    
    Sleep ( 1 )

AutoIt 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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.