iahngy Posted February 26, 2014 Posted February 26, 2014 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)
Moderators JLogan3o13 Posted February 26, 2014 Moderators Posted February 26, 2014 (edited) From the help file under @ComSpec Run(@comspec & " /k help | more") Edited February 26, 2014 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
JohnOne Posted February 26, 2014 Posted February 26, 2014 run(@Comspec & " /c","", @SW_SHOW, $RUN_CREATE_NEW_CONSOLE) Maybe. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Malkey Posted February 27, 2014 Posted February 27, 2014 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 & " /?")
Moderators JLogan3o13 Posted February 27, 2014 Moderators Posted February 27, 2014 @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 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
iahngy Posted February 27, 2014 Author Posted February 27, 2014 JLogan, that just display the help ...you hve the actual example ?
Moderators JLogan3o13 Posted February 27, 2014 Moderators Posted February 27, 2014 iahngy, you asked how to keep your command window visible. The point I was making is, instead of /c you want /k "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Gianni Posted February 27, 2014 Posted February 27, 2014 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) Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....
iahngy Posted February 27, 2014 Author Posted February 27, 2014 Thank you Pinco very much.. I ll just use the example from MHz to simulate Dos window.
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