CFExecute results while an EXE is running

Greetings all,
        I'd like to know if there is a way I can have my executable return results during a CFExecute so that the user executing the can visually see the progress its making. If I understand this correctly, I want to have the CFExecute loop while this executable is running and return some results. Something similiar to the following......

<CFEXECUTE NAME="C:\blah.exe"

Does this look correct ? If the executable writes to blah_progress.log will CF pick it up and place it on the page while the timeout is waiting for the executable to finish ?

Suggestions are appreciated, thank you in advance
LVL 15
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The timeout attribute on <cfexecute> will force CF to wait for it to finish processing before continuing execution of the rest of the CF template.  If you need to read, parse and/or display the contents of blah_progress.log, then use <cffile> to read the contents of the file into a variable and do what you need to do:

<cfexecute ...>

  blah_progress_output = '';
<cfif FileExists("C:\blah_progress.log")>
  <cffile action="read" file="C:\blah_progress.log" variable="outout">
    blah_progress_output = Trim(output);

ComputronAuthor Commented:
Thanks for answering Jeff

So you are suggesting that I omit the timeout so it doesn't block CF, and just have CF continue to read this log for progress updates ?

The entire process will only take a minute at the most I would guess. How will CF know that my CF Execute is done ? Deelte the progress log and its over ?

Is this the best way to feed results back to a page from the EXE for the user to view an in progress scenario ?
I misread your question.  I don't think there's any way to output the results of the call to the <cfexecute> *as* it's happening.
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

I would offer something that may not be worth the effort, but you can consider it. It is basically building on JeffHowden's 'proposal'.  If you have access to the program for modifications, change it to write some particular line at the end when it is completed, then redirect the output to a file and display the results in a loop, getting pieces of the file as they become available within a cffile loop... basically , read records and keep track of where you were at, then re-read and display more if it is available.

Do this in a loop. with a Pause in the loop, you can use this trick
Maybe output more data every 10 seconds.

You can protect yourself from the program dying and not outputting all it's data by putting a counter in and only looping for X number of itterations (at 10 seconds each, or whatever, you can time it out to however long you want).

This would be dependent on knowing when the output is done from the program though via a special string or character... or, if you knew it output data pretty regularly, maybe you do a 5 second pause loop, and if there is no new data, you consider it done, or something similar...

As I said, it may not be worth it, but it could work reasonably well depending on your requirements and ability to modify what is in place.
ComputronAuthor Commented:
Thanks for the responses guys. I went about this a bit different as there just wasn't a clean way to accomplish this.
I believe that the question was answered. The given answers provided methods to do this, or input on why it really isn't possible to do exactly what was originally requested.  It is my opinion that points should be allocated.
I agree with RCorfman, FWIW.
Closed, no 500 points refunded.
The Experts Exchange
Community Support Moderator of all Ages

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.