Jump to content
Sign in to follow this  

GUI Combot liste

Recommended Posts


#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>


Func Example()
    ; Create a GUI with various controls.
    Local $hGUI = GUICreate("Example", 300, 200)
    $MSTSCPath = @SystemDir ;~ & "\MSTSC.exe"

    ; Create a combobox control.
    Local $iComboBox = GUICtrlCreateCombo("501", 10, 10, 185, 20)
    Local $iClose = GUICtrlCreateButton("Close", 210, 170, 85, 25)

    ; Add additional items to the combobox.
    GUICtrlSetData($iComboBox, "502|503", "504")

    ; Display the GUI.
    GUISetState(@SW_SHOW, $hGUI)

    Local $sComboRead = ""

    ; Loop until the user exits.
    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE, $iClose

            Case $iComboBox
                $sComboRead = GUICtrlRead($iComboBox)
                MsgBox($MB_SYSTEMMODAL, "", "The combobox is currently displaying: " & $sComboRead, 0, $hGUI)
                run($MSTSCPath & "MSTSC.exe" & " /admin /v:MGNET"& $iComboBox "-sv005")


    ; Delete the previous GUI and all controls.
EndFunc   ;==>Example

I took the help script file to make a training before make my script

-i got that combot list (try the script if you whant) with 3 item inside


i added that line (LINE:32)

run($MSTSCPath & "MSTSC.exe" & " /admin /v:MGNET"& $iComboBox & "-sv005")

what does i missing to do the cmd command in that "run" call

MSTSC.exe /admin /v:MGNET501-sv005

The finality is to select the item 503

and when i click on it. I wanna run the associed item to connect on a server with that command

MSTSC.exe /admin /v:MGNET503-sv005

hope i am clear xD cause my english is bad (sry) :)

Edited by caramen

Share this post

Link to post
Share on other sites

  run( "C:\Windows\System32\mstsc.exe"&" /admin /v:MGNET"&$iComboBox&"-sv005")

That's the answer but hmmmm why my first line is not working ???

run($MSTSCPath&"MSTSC.exe") =/= run( "C:\Windows\System32\mstsc.exe") ????

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