Student_coder Posted May 27, 2016 Share Posted May 27, 2016 Quote Which is the easiest way to append CMD to the GUI ?? Can anyone suggest me. Link to comment Share on other sites More sharing options...
pranaynanda Posted May 27, 2016 Share Posted May 27, 2016 Have the command in an input box and assign it to a variable and then take that value from input box and put it in the Run() statement. Link to comment Share on other sites More sharing options...
Student_coder Posted May 27, 2016 Author Share Posted May 27, 2016 @pranaynanda If we do in that way then CMD will run in separate window na?? Quote I want it in the GUI. For example if we press one button then cmd should run below the button in the same GUI. Link to comment Share on other sites More sharing options...
pranaynanda Posted May 27, 2016 Share Posted May 27, 2016 (edited) What do you wish to achieve? If you do it my way, then you can have your commands run in cmd. You can get the output using StdoutRead or get it to display in any other GUI element you like. Edit: And it won't run it in a separate window. You can do it like this: $a=InputBox("Command","Enter the command") ;Enter command $b=Run($a,"", @SW_MAXIMIZE, $STDERR_CHILD + $STDOUT_CHILD);run the command ProcessWaitClose($b); pause until the process completes $Message = StdoutRead($b, True) ; Read the output MsgBox(0, "Output", $b) ;Print the output in a message box Edited May 27, 2016 by pranaynanda Link to comment Share on other sites More sharing options...
Student_coder Posted May 27, 2016 Author Share Posted May 27, 2016 @pranaynanda ok Pranay. I will try as you said. Thanks. Link to comment Share on other sites More sharing options...
Student_coder Posted May 27, 2016 Author Share Posted May 27, 2016 @pranaynanda - Sorry to disturb you again Pranay. In the code you have given me will display the output in a msgbox na....... I want the output too in the same GUI...... That's what am asking....... Can you help me with this ?? Link to comment Share on other sites More sharing options...
shornw Posted May 27, 2016 Share Posted May 27, 2016 You wouldn't want $b as the output - Try slightly modified as below. #include <AutoItConstants.au3> #include <MsgBoxConstants.au3> $a=InputBox("Command","Enter the command") ;Enter command $b=Run($a,"", @SW_MAXIMIZE, $STDERR_CHILD + $STDOUT_CHILD);run the command ProcessWaitClose($b); pause until the process completes $Message = StdoutRead($b, True) ; Read the output MsgBox(0, "Output", $message) ;Print the output in a message box Quote I want the output too in the same GUI..... $message is a variable that you can use in your GUI (unless I'm completely missing what you want) [font='Comic Sans MS']Eagles may soar high but weasels dont get sucked into jet engines[/font] Link to comment Share on other sites More sharing options...
AutoBert Posted May 27, 2016 Share Posted May 27, 2016 GuiCtrlSetData will assign Data to a GuiCtrl. Link to comment Share on other sites More sharing options...
Student_coder Posted May 27, 2016 Author Share Posted May 27, 2016 ok thanks ... I got it Link to comment Share on other sites More sharing options...
pranaynanda Posted May 27, 2016 Share Posted May 27, 2016 7 hours ago, shornw said: You wouldn't want $b as the output Yeah, I missed that. My mistake. 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