Jump to content
Sign in to follow this  

Need help displaying cmd text in an edit box

Recommended Posts

Hi, I guess ill start with my code snippet...

This Runs a batch file which works fine

$startscan = RunWait("startscan.bat")

I want to display the cmd output into an edit box

I have comeup with this but it is obviously completely wrong as it doesnt work :)

$getcommandinfo = StdOutRead($startscan)

$editbox = GUICtrlCreateEdit("", 24, 56, 377, 185)
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
GUICtrlSetData($editbox, $getcommandinfo)

The script runs fine, the batch file runs and finishes successfully but the edit box is just blank, I want the edit box to display what it in the cmd box and I want to hide the cmd box?

thanks - i hope u get what i mean

Share this post

Link to post
Share on other sites

Check this example to get the idea:

$MAIN = GUICreate("Example")
$EDIT = GUICtrlCreateEdit("",5,5,390,365,BitOR(0x00200000,0x0800))
$INPUT = GUICtrlCreateInput("systeminfo",5,375,330,20)
$RUN = GUICtrlCreateButton("RUN",340,375,55,20)

While True
    Switch GUIGetMsg()
        Case $RUN
            $CMD = GUICtrlRead($INPUT)
            If $CMD <> "" Then
                $PID = Run(@ComSpec & " /C " & $CMD, "",@SW_HIDE,0x2)
        Case -3

When the words fail... music speaks

Share this post

Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...