Watt Posted August 8, 2004 Share Posted August 8, 2004 Hi to All!! Just a little problem: How can i get data/strings/chars from a CMD window? i use this to open the window: RunWait(@ComSpec & " /c " & "image_test.bat", "", @SW_MAXIMIZE) THX Watt Link to comment Share on other sites More sharing options...
pekster Posted August 8, 2004 Share Posted August 8, 2004 How can i get data/strings/chars from a CMD window? <{POST_SNAPBACK}>2 methods.If the command you used outputs to stdout (standard output) then you can pipe it to a file, and have AutoIt read that. To do this, just use command > file.txt and read the file for any output data.If the command returns an exit code, use RunWait(), and store the return to a variable to get the exit code.You cannot get the text that is in a command window using AutoIt. [font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes. Link to comment Share on other sites More sharing options...
Watt Posted August 8, 2004 Author Share Posted August 8, 2004 HI!! Sorry, but the output of the CMD process has a moving progress bar (chars), and a percent number. I need the percent number. If i transferred the output (>) into a file, but the size of the output file was growing because of the progress bar... i tried to open this file and read in it, but i could not, always got back the same string... 006% ####...................................................................... 006% ####...................................................................... 006% ####...................................................................... 006% ####...................................................................... 006% ####...................................................................... This program what i run is the "nerocmd" from ahead... THX Link to comment Share on other sites More sharing options...
CyberSlug Posted August 8, 2004 Share Posted August 8, 2004 Alt+Space activates the window menu; E,S,Enter selects all text and copies it to the clipboard $title = "Command Prompt";change as needed WinActivate($title) WinWaitActive($title) Send("!{SPACE}es{ENTER}") $text = ClipGet() ; sleep and repeat the above and compare the text Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
Watt Posted August 8, 2004 Author Share Posted August 8, 2004 HI! THX for alt+space!!!! useful thing i have to translate the E and S into the hungarian XP By the way, will it work if i hide the CMD window? I will try... I am so tired... CyberSlug if u have time (?) plz watch my other topic in BUG REPORT (FileSelectFolder). It is very interesting.... Thx Watt 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