squid808 0 Posted November 1, 2010 Hi, Just looking to see if anyone knows a good way to paste into a command prompt window - in the GUI I'm working on it has the option of a verbose mode. When checked it shows you it typing in to the prompt rather than hiding it, but so far I can only get it to work using send() which, when you have a few lines to go through multiple times, gets slow. Also, if anyone has a better way of making sure it activates the CMD window (the title of the window is different in different OSes) that'd be great. Any thoughts? Code snippet: Case $checkverbose = $GUI_CHECKED Run("cmd.exe") winactivate("[CLASS:ConsoleWindowClass]","") winwaitactive("[CLASS:ConsoleWindowClass]","",4) for $i=0 to $maxcount-1 winactivate("[CLASS:ConsoleWindowClass]","") winwaitactive("[CLASS:ConsoleWindowClass]","",4) send(_GUICtrlListView_GetItemText($ListView, $i, 1)) sleep(250) send("{ENTER}") sleep(250) Next winactivate("[CLASS:ConsoleWindowClass]","") winwaitactive("[CLASS:ConsoleWindowClass]","",4) EndSelect Share this post Link to post Share on other sites
UEZ 1,298 Posted November 1, 2010 I don't know whether this is something you are looking for but have a look here: http://www.autoitscript.com/forum/index.php?showtopic=121658&view=findpost&p=844465 It will run the command from the inputbox in cmd. 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!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Share this post Link to post Share on other sites
squid808 0 Posted November 2, 2010 Thanks UEZ, I've used the Run and @comspec combination before (as well as shell execute) and it would work great if only there was a way to run the subsequent commands from the same window rather than separately. I'll keep looking, though. Maybe there is a way to do it. In the meantime I'm trying to figure out how to use this StdoutRead stuff to capture errors from the non-verbose mode =) Share this post Link to post Share on other sites