hozdaman Posted April 18, 2010 Posted April 18, 2010 Hi, I am trying to create a script that will open a msgbox combobox that when you select an option it opens another combobox. When I execute the code below it will open the first combobox, but when I select "malaware" the script just stops. Any help with be really great. Thanks. expandcollapse popup;Required includes #include<GUIConstantsEx.au3>;constants for GUI events #include<EditConstants.au3>;Edit Constants. Required for the styles we used. #include<GUIConstants.au3> ;GUI Creation GUICreate("PC ToolMan Utilities", 225, 80) ;Combobox Creation $combobox = GUICtrlCreateCombo("Malawarebytes", 10, 10, 120, 20) GUICtrlSetData(-1, "CCleaner|Combofix|Win Utilities") ;Button Creation $button = GUICtrlCreateButton("Open", 10, 40, 60, 20) GUISetState(@SW_SHOW) While 1 $guimsg = GUIGetMsg() Select Case $guimsg = $button ;MsgBox(0, "", "Choose an option " & GUICtrlRead($combobox) & ".") Select Case GUICtrlRead($combobox) = "Malawarebytes" Run('malaware()') Exit Case GUICtrlRead($combobox) = "CCleaner" Run('notepad.exe') Exit Case GUICtrlRead($combobox) = "Combofix" Run("combofix()") Case ($combobox) = "Win Utilities" Run("winutl()") Exit EndSelect Case $guimsg = $GUI_EVENT_CLOSE Exit EndSelect WEnd Func malaware() ;GUI Creation GUICreate("Malawarebytes", 225, 80) ;Combobox Creation $combobox1 = GUICtrlCreateCombo("Install", 10, 10, 120, 20) GUICtrlSetData(-1, "Uninstall") ;Button Creation $button1 = GUICtrlCreateButton("Run", 10, 40, 60, 20) While 1 $guimsg = GUIGetMsg() Select Case $guimsg = $button1 ;MsgBox(0, "", "Choose an option" & GUICtrlRead($combobox1) & ".") Select Case GUICtrlRead($combobox1) = "Install" Run('C:\Documents and Settings\PC ToolMan\My Documents\Downloads\mbam-setup-1.45.exe') Exit Case GUICtrlRead($combobox1) = "Uninstall" Run('notepad.exe') Exit EndSelect Case $guimsg = $GUI_EVENT_CLOSE Exit EndSelect WEnd EndFunc ;==>malaware
spudw2k Posted April 18, 2010 Posted April 18, 2010 (edited) The Run command is only used for calling external exes. You should/can not use it to call internal functions. Just call them by name. Case GUICtrlRead($combobox) = "Malawarebytes" malaware() Exit Case GUICtrlRead($combobox) = "CCleaner" Run('notepad.exe') Exit Edited April 18, 2010 by spudw2k Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF
hozdaman Posted April 18, 2010 Author Posted April 18, 2010 Thanks for your help. I have one other question. I am going to create a zip file for all the installers (i.e malawarebytes, ccleaner...), currently they are in my documents and settings if i make this portable what path do I use? Thanks.
ForsakenGod Posted April 18, 2010 Posted April 18, 2010 if it will be a part of your package and it will be near the exe you re making could be @ScriptDir
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