darkjohn20 Posted June 17, 2010 Share Posted June 17, 2010 (edited) I have a main GUI application that I want to call a few command prompts to display data in them.$hCMD = Run("cmd.exe", "", @SW_SHOW, $STDIN_CHILD + $STDOUT_CHILD) StdinWrite($hCMD, "echo Hello" & @CRLF)I've tried both $STDIN_CHILD alone and $STDIN_CHILD + $STDOUT_CHILD, but neither work.I noticed that:$hCMD = Run("cmd.exe", "", @SW_SHOW, $STDIN_CHILD) StdinWrite($hCMD, "echo Hello" & @CRLF)Writes "Hello" to the Scite console, and writes nothing when compiled.What am I doing wrong?Edit: Fixed my examples to include &CRLF in StdinWrite. Edited June 17, 2010 by darkjohn20 Link to comment Share on other sites More sharing options...
UEZ Posted June 17, 2010 Share Posted June 17, 2010 (edited) You have to use #AutoIt3Wrapper_Change2CUI=y!Try this:#AutoIt3Wrapper_Change2CUI=y #include <Constants.au3> $hCMD = Run("cmd.exe", "", @SW_SHOW, $STDIN_CHILD) StdinWrite($hCMD, "echo Hello" & @CRLF) ExitCompile and run it in CMD!BR,UEZ Edited June 17, 2010 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
darkjohn20 Posted June 17, 2010 Author Share Posted June 17, 2010 "I have a main GUI application" The main program needs to be a GUI application, it cannot be a CUI. I want it to create a few command prompts that it can write to. I don't want to use them for actual commands, such as "ping" or "tree", but rather just to display information. Link to comment Share on other sites More sharing options...
UEZ Posted June 17, 2010 Share Posted June 17, 2010 You can still use GUIs but ConsoleWrite will prompt directly to CMD! The only disadvantage I see is when you start the exe it will open CMD and it will close not until the exe has been closed first. BR, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
darkjohn20 Posted June 17, 2010 Author Share Posted June 17, 2010 (edited) And what if I need to output to multiple different CMD windows? I would like to have my main GUI control about 3 cmd windows, which wouldn't necessarily be running all of the time. Edited June 17, 2010 by darkjohn20 Link to comment Share on other sites More sharing options...
bo8ster Posted June 18, 2010 Share Posted June 18, 2010 (edited) And what if I need to output to multiple different CMD windows? I would like to have my main GUI control about 3 cmd windows, which wouldn't necessarily be running all of the time.That is possible however main program would have to spawn the CMD windows, know their pids then write to the cmd windows. I question the use of that. If you want to output information, use there different log files.If you want to interface to another cmd program then you will have your work cut out for you. As for the first post, there is a UDF for diskpart here http://www.autoitscript.com/forum/index.php?app=core&module=attach§ion=attach&attach_id=26230 which may help. Edited June 21, 2010 by bo8ster Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic] Link to comment Share on other sites More sharing options...
darkjohn20 Posted June 18, 2010 Author Share Posted June 18, 2010 I solved the issue. I created a separate script that would run as a CUI, and ConsoleWrite any text written to a hidden window with ControlSetText. I've decided that a few CMD windows is too messy anyway, so I've abandoned the idea. Thanks anyway. Link to comment Share on other sites More sharing options...
ProgAndy Posted June 19, 2010 Share Posted June 19, 2010 If you need the cmd-window just for output, you also could create a custom GUI with a textbox in read-only mode. Then you could use _GUICtrlEdit_AppendText to append data. *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
Richard Robertson Posted June 19, 2010 Share Posted June 19, 2010 One process can't allocate more than one console. How would you even manage to do that? 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