Jump to content
Sign in to follow this  
iahngy

how can i read dos window text w/o losing the window.

Recommended Posts

iahngy

I need the window dos  from @comspec to show all times so I can read the output status on it.

so I cant use Run(@ComSpec & " /c " & 'commandName', "", @SW_show)  because it always

disappear after the commands.

so I try the code below, but I cant get the stdoutread  ...if I set for run other option to read dos , it will read but the dos disappear ...wonder if you can give any way to read dos w/o losing the dos window.

 

 

run(@Comspec,"", @SW_SHOW, $RUN_CREATE_NEW_CONSOLE)

 WinWaitActive("cmd.exe")
    ControlSend ("cmd.exe", "", "", "test.bat {enter}")
winwaitactive("anotherwindow")

Local $sOutput = StdoutRead($iPID)

Share this post


Link to post
Share on other sites
Malkey

 

From the help file under @ComSpec

Run(@comspec & " /k help | more")

I believe this help file example does not work on :-

Running:(3.3.10.2);

Environment(Language:0409  Keyboard:00000409  OS:WIN_7/Service Pack 1  CPU:X64 OS:X64).

 

run(@Comspec & " /c","", @SW_SHOW, $RUN_CREATE_NEW_CONSOLE)

Maybe.

Magic variables don't work.

 

I found this example works for me.  Plus, it  shows the meaning of the "/c" and "/k" command options.

ConsoleWrite(@ComSpec & @LF) ; FYI

;Run(@ComSpec & " /k " & @ComSpec & " /?")

; Or

RunWait(@ComSpec & " /k " & @ComSpec & " /?")

Share this post


Link to post
Share on other sites
JLogan3o13

@Malkey Did you try the example? It works for me as written on 3.3.10.0 through 3.3.11.3 Beta, on WIN7 32 and 64 bit as well as 8.1. I would not suggest it if I hadn't tested it out ;)


√-1 2^3 ∑ π, and it was delicious!

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites
iahngy

JLogan,  that just display the help ...you hve the actual example ?

Share this post


Link to post
Share on other sites
Chimp

when you redirect Std_I/O of the cmd, the input and output streams will no more displayed on the cmd screen but redirected to the "redirected" streams instead.
if you want to view what's going on, you have to simulate a cmd screen and send the streams to it.
>here an example from MHz (you should remove "MsgBox(0, 'tail', $tail)" near the end of the listing)


small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Share this post


Link to post
Share on other sites
iahngy

Thank you Pinco very much.. I ll just use the example from MHz to simulate Dos window.

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  

×