stev379 Posted July 20, 2005 Share Posted July 20, 2005 How can I get the command window to stay open so the results of a run file will be displayed? For example: $ipconfig = Run (@ComSpec & " /c " & @SystemDir & "\ipconfig.exe /all", @SystemDir, @SW_SHOW) If it's easier or also possible to display the results in a message or GUI window, that would server the purpose as well. Thanks!! Link to comment Share on other sites More sharing options...
herewasplato Posted July 20, 2005 Share Posted July 20, 2005 ...probably an "AutoIt way"... but I would just make a *.bat file with: ipconfig /all pause and use RunWait to call the bat file.............. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
layer Posted July 20, 2005 Share Posted July 20, 2005 You can display the results with the latest BETA inside of a GUI... Check it out, it's very useful. FootbaG Link to comment Share on other sites More sharing options...
jefhal Posted July 20, 2005 Share Posted July 20, 2005 Wouldn't this work?: $ipconfig = Run (@ComSpec & " /k " & @SystemDir & "\ipconfig.exe /all", @SystemDir, @SW_SHOW) ...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format Link to comment Share on other sites More sharing options...
stev379 Posted July 20, 2005 Author Share Posted July 20, 2005 Wouldn't this work?:$ipconfig = Run (@ComSpec & " /k " & @SystemDir & "\ipconfig.exe /all", @SystemDir, @SW_SHOW)<{POST_SNAPBACK}>Bada Bing! That does it. Thanks!! Link to comment Share on other sites More sharing options...
herewasplato Posted July 20, 2005 Share Posted July 20, 2005 (edited) Run (@ComSpec & " /c " & @SystemDir & "\ipconfig.exe /all")Run (@ComSpec & " /k " & @SystemDir & "\ipconfig.exe /all")forgot about that /k option... or make a pretty GUIedit - jefhal beat me to it - I got side tracked during my replyedit2 - sorry for the large triple post.So that is what happens when you hit the button more than once. :-( Edited July 20, 2005 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
blindwig Posted July 20, 2005 Share Posted July 20, 2005 How can I get the command window to stay open so the results of a run file will be displayed?Try this:$ipconfig = Run (@ComSpec & " /c " & @SystemDir & "\ipconfig.exe /all & PAUSE", @SystemDir, @SW_SHOW) My UDF Threads:Pseudo-Hash: Binary Trees, Flat TablesFiles: Filter by Attribute, Tree List, Recursive Find, Recursive Folders Size, exported to XMLArrays: Nested, Pull Common Elements, Display 2dSystem: Expand Environment Strings, List Drives, List USB DrivesMisc: Multi-Layer Progress Bars, Binary FlagsStrings: Find Char(s) in String, Find String in SetOther UDF Threads I Participated:Base64 Conversions Link to comment Share on other sites More sharing options...
herewasplato Posted July 20, 2005 Share Posted July 20, 2005 (edited) @blindwig, "& PAUSE" - good one I learn new things everyday... ...forget things everyday... ...but I'll soon forget that I forgot, so it is all okay. edit: forgot how to spell Edited July 20, 2005 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
nobby Posted July 20, 2005 Share Posted July 20, 2005 Herwasplato... Could you please give me a pointer regarding creating the GUI that would host the cmd window? A keyword to do a help file search would suffice. I think I got the GUI create OK but not the display cmd... CheersNobby Link to comment Share on other sites More sharing options...
herewasplato Posted July 20, 2005 Share Posted July 20, 2005 @nobby, I know nothing about GUIs. I was just commenting on what layer stated in post #3 of this thread. I would not even know what to tell you to search for. See if layer responds to this with what you want.............. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
layer Posted July 20, 2005 Share Posted July 20, 2005 (edited) First, go download the beta from here: http://www.autoitscript.com/autoit3/files/beta/autoit/Then, put constants.au3 in the same dir as THIS script:#include <GUIConstants.au3> #include "constants.au3" $gui = GUICreate("console stuff") $edit = GUICtrlCreateEdit("", 10, 10, 300, 300, BitOr($WS_VSCROLL, $WS_HSCROLL,$ES_READONLY)) GUISetState() $ping = Run(@ComSpec & " /c ping google.com", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) While 1 $lineout = StdoutRead($ping) If @Error = -1 Then ExitLoop GUICtrlSetData($edit, $lineout & @CRLF, 1) WEnd While 1 $get = GUIGetMsg() If $get = -3 Then Exit WEndThen run it with the BETA. EDIT: But I'm too tired to figure out how to put the ipconfig in there... Going to bed now, soooo tired, but gotta get up EARLY tomorrow. Edited July 20, 2005 by layer FootbaG Link to comment Share on other sites More sharing options...
nobby Posted July 20, 2005 Share Posted July 20, 2005 Thanks, That's exactly what I needed... CheersNobby 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