GregThompson Posted May 15, 2009 Share Posted May 15, 2009 (edited) Is there a way to clear the data from the reads of a CMD window? I'm opening a command prompt, remoting into a machine with ODBC's to an MDB and running OSQL to pull info. Once I've run the OSQL command I want to read it's output only into a variable, and then send another, read it into a variable, etc, etc... it's very basic so far, using the AutoIT example as a base. Local $foo = RunAs("user","domain","pass",0,@ComSpec & " /k c:\downloads\pstools\beyondexecv2 \\seclpcadsm01 cmd","c:\downloads\pstools",@SW_SHOW,$STDIN_CHILD + $STDOUT_CHILD) StdinWrite($foo, "osql -S seclpcansdb01 -U user -P pass -e -b -Q" & '"select domain_uuid from ca_discovered_hardware where host_name=' & "'lxpls981mis010'" & @CRLF) Sleep(5000) StdinWrite($foo) Local $data While True $data &= StdoutRead($foo) If @error Then ExitLoop Sleep(25) WEnd MsgBox(0, "Debug", $data) Edited May 15, 2009 by GregThompson Link to comment Share on other sites More sharing options...
flyingboz Posted May 15, 2009 Share Posted May 15, 2009 1) Locate _RunReadStd() 2) Download it. 3) Use it. All of your troubles will go away Reading the help file before you post... Not only will it make you look smarter, it will make you smarter. Link to comment Share on other sites More sharing options...
herewasplato Posted May 15, 2009 Share Posted May 15, 2009 1) Locate _RunReadStd()http://www.autoitscript.com/forum/index.php?showtopic=41894:-) [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
flyingboz Posted May 16, 2009 Share Posted May 16, 2009 1) Locate _RunReadStd()http://www.autoitscript.com/forum/index.php?showtopic=41894:-)thx , plato -- I need to bookmark that link , I'm rarely in the forums these days. Reading the help file before you post... Not only will it make you look smarter, it will make you smarter. Link to comment Share on other sites More sharing options...
GregThompson Posted May 18, 2009 Author Share Posted May 18, 2009 Thanks fellas, I really appreciate it! 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