Jump to content
Sign in to follow this  

STDIn/Out stuff!

Recommended Posts


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)


Local $data
While True
    $data &= StdoutRead($foo)
    If @error Then ExitLoop
MsgBox(0, "Debug", $data)
Edited by GregThompson

Share this post

Link to post
Share on other sites

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.

Share this post

Link to post
Share on other sites

Thanks fellas, I really appreciate it!

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.