Jump to content
Sign in to follow this  
caramen

GUI Combot liste

Recommended Posts

caramen

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

Example()

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
                ExitLoop

            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")

        EndSwitch
    WEnd

    ; Delete the previous GUI and all controls.
    GUIDelete($hGUI)
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

            501-502-503

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

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
caramen

  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") ????

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

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  

×