Jump to content

Appending CMD to the GUI


Recommended Posts

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 by pranaynanda
Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...