jerryp Posted January 4, 2007 Share Posted January 4, 2007 THis is my fist day using AutoIt and it is GREAT!! I am wrinting a simple script to run an old dos program. All is working well, except I do not know how, if it is possible, to read the active screen and parse the information read. Any suggestions? Thanks, Jerry Link to comment Share on other sites More sharing options...
herewasplato Posted January 5, 2007 Share Posted January 5, 2007 Welcome to the forum. It really depends on the program. Some are more like a command prompt. Others use graphic interfaces that are hard to read via AutoIt. Here is a sample code to try if your DOS app is more like a cmd window:;open a hidden 'DOS' window and 'dir' root $PID = Run(@ComSpec & " /c " & 'dir c:\ /A:H', "", @SW_HIDE, 2) $Out = "" While 1 ;read one line from 'DOS' window $line = StdoutRead($PID) ;exit this loop if it is the last line from that window If @error Then ExitLoop ;look for a string in the current line If StringInStr($line, "boot.ini") Then MsgBox(0, "", "Found boot.ini") ;concatenate all line into one variable $Out &= $line WEnd MsgBox(0, "", $Out) [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now