Sign in to follow this  
Followers 0
surfer

reading console output from a prog?

7 posts in this topic

Hello,

how is it possible to read for example the dir output at the console?

C:\dir

list some files and I want check if ther is a specific name on the window or if I execute another program I want read the output.

How is this possible I couldn't find some thread or help.

Thank a lot

Greetings surfer

Share this post


Link to post
Share on other sites



Hello,

how is it possible to read for example the dir output at the console?

C:\dir

list some files and I want check if ther is a specific name on the window or if I execute another program I want read the output.

How is this possible I couldn't find some thread or help.

Thank a lot

Greetings surfer

You could use the example in the help file for FileFindFirstFile


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

#include <File.au3>
_FileListToArray($sPath [, $sFilter [, $iFlag]])

could you not use this command - which will do your dir /b command and output the info to an array which you can read to see if that value is there then execute the second program

Share this post


Link to post
Share on other sites

Hello,

my main quetion is how to read something from the console?

Thereby should it be possible to use any kind of programs at the console an read its output at the console.

Has somebody an hint?

Thanks

surfer

Share this post


Link to post
Share on other sites

The beta release version of AutoIt has StdoutRead and StderrRead functions made for reading console output from programs run by AutoIt.

You can search this forum for posts about these functions by searching for +stdoutread*


Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.

Share this post


Link to post
Share on other sites

you could as well write the output to a txt-file

c:\dir > output.txt

and then read whats in your txt-file

maybe that helps you

from the helpfile = this does the dir and put the info to an array which you can use or pipe to a text file, save you having to use the dir command

#Include <File.au3>

#Include <Array.au3>

$FileList=_FileListToArray(@DesktopDir)

If (Not IsArray($FileList)) and (@Error=1) Then

MsgBox (0,"","No Files\Folders Found.")

Exit

EndIf

_ArrayDisplay($FileList,"$FileList")

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