Sign in to follow this  
Followers 0
Swatty43

Help with checkboxes and sending data to batch file.

7 posts in this topic

Hi Everyone,

I am writing a script to run a command line malware scanner. I have made this simple GUI with 8 checkboxes:

Func gui2()
$hGui2 = GUICreate("Emsisoft CMD Scanner", 398, 180, 758, 328)
$Gui2MenuFile = GUICtrlCreateMenu("&File")
GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
$Gui2FileExit = GUICtrlCreateMenuItem("Exit", $Gui2MenuFile)
GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
$Gui2MenuHelp = GUICtrlCreateMenu("&Help")
GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
$Gui2MenuAbout = GUICtrlCreateMenuItem("About", $Gui2MenuHelp)
GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
$Gui2MenuInfo = GUICtrlCreateMenuItem("Malwarebytes Info", $Gui2MenuHelp)
GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
$Pic1 = GUICtrlCreatePic("C:\Users\mswatek\Desktop\C1RepairUtility\Files\Tools\BG.jpg", 0, 0, 397, 177)
GUICtrlSetState($Pic1, $GUI_DISABLE)
$Label1 = GUICtrlCreateLabel("Emsisoft CMD scanner", 100, 8, 240, 22)
GUICtrlSetBkColor(-1, 0xC0C0C0)
GUICtrlSetFont(-1, 14, 800, 0, "Terminal")
GUICtrlSetColor(-1, 0x0000FF)
$update = GUICtrlCreateButton("Update", 32, 48, 75, 25)
GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
$vquar = GUICtrlCreateButton("View QUAR", 32, 88, 75, 25)
GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
$dquar = GUICtrlCreateButton("Delete QUAR", 32, 128, 75, 25)
GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
$cb1 = GUICtrlCreateCheckbox("Quick", 136, 48, 49, 17)
GUICtrlSetBkColor(-1, 0xC0C0C0)
$cb2 = GUICtrlCreateCheckbox("Smart", 192, 48, 49, 17)
GUICtrlSetBkColor(-1, 0xC0C0C0)
$cb3 = GUICtrlCreateCheckbox("Deep", 248, 48, 49, 17)
GUICtrlSetBkColor(-1, 0xC0C0C0)
$cb4 = GUICtrlCreateCheckbox("RootKit", 248, 72, 58, 17)
GUICtrlSetBkColor(-1, 0xC0C0C0)
$cb5 = GUICtrlCreateCheckbox("Memory", 224, 96, 58, 17)
GUICtrlSetBkColor(-1, 0xC0C0C0)
$cb6 = GUICtrlCreateCheckbox("Traces", 192, 72, 50, 17)
GUICtrlSetBkColor(-1, 0xC0C0C0)
$cb7 = GUICtrlCreateCheckbox("Cookies", 160, 96, 55, 17)
GUICtrlSetBkColor(-1, 0xC0C0C0)
$cb8 = GUICtrlCreateCheckbox("PUP", 136, 72, 41, 17)
GUICtrlSetBkColor(-1, 0xC0C0C0)
$all = GUICtrlCreateButton("All", 320, 48, 51, 17)
GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
$none = GUICtrlCreateButton("None", 320, 72, 51, 17)
GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
$scan = GUICtrlCreateButton("Scan", 176, 128, 75, 25)
GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
GUISetState()
EndFunc

My issue is I do not want to have to code every single possible outcome of each check box ie cb1,cb2, cb5,cb6 selected etc... So each check box represents a command line switch, I then read whether or not the check box is checked if it is I then pass the varible to a batch file that then executes the program. 

I am attaching my function in a separate file since it is already too large to fit. As you can see in the attached file I have already coded alot of the different outcomes. But there has to be a better way to handle this, I just can't think of a better way to do this. 

Here is the code for my batch file that I have been using for testing:

@echo off
color 79
mode con cols=80 lines=40 >nul
title Scan
echo.
set quick=%1
set smart=%2
set deep=%3
set rootkit=%4
set memory=%5
set traces=%6
set cookies=%7
set pup=%8

echo.
echo %quick% %smart% %deep% %rootkit% %memory% %traces% %cookies% %pup%
pause
exit

Any ideas/help/suggestions is much appreciated!!!

FuncScan.au3

Share this post


Link to post
Share on other sites

You're creating a command line, so instead of looking for every possible connection just concatenate the commands as you scan the checkboxes, that way you'd only need 8 If statements, one for each checkbox.

Something along the lines of this.

$CommandLine = '"'
If GUICtrlRead($cb1) = $GUI_CHECKED Then
    $CommandLine &= $quick & '" "'
EndIf

If GUICtrlRead($cb2) = $GUI_CHECKED Then
    $CommandLine &= $smart & '" "'
EndIf
; and on and on
$CommandLine = StringLeft($CommandLine, StringLen($CommandLine) - 3) & '"' ; removes the '" "' from the end of the string and adds a single quote

;~ And GUICtrlRead($cb3) = $GUI_CHECKED And GUICtrlRead($cb4) = $GUI_CHECKED And GUICtrlRead($cb5) = $GUI_CHECKED And GUICtrlRead($cb6) = $GUI_CHECKED And GUICtrlRead($cb7) = $GUI_CHECKED And GUICtrlRead($cb8) = $GUI_CHECKED Then

ShellExecute("C:\Users\%username%\Desktop\C1RepairUtility\Files\Scripts\Batch\Scan.cmd",$CommandLine)

Although, you could probably get rid of the whole batch file and just use AutoIt to run the program with the command line parameters this way.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

You're creating a command line, so instead of looking for every possible connection just concatenate the commands as you scan the checkboxes, that way you'd only need 8 If statements, one for each checkbox.

Something along the lines of this.

$CommandLine = '"'
If GUICtrlRead($cb1) = $GUI_CHECKED Then
    $CommandLine &= $quick & '" "'
EndIf

If GUICtrlRead($cb2) = $GUI_CHECKED Then
    $CommandLine &= $smart & '" "'
EndIf
; and on and on
$CommandLine = StringLeft($CommandLine, StringLen($CommandLine) - 3) & '"' ; removes the '" "' from the end of the string and adds a single quote

;~ And GUICtrlRead($cb3) = $GUI_CHECKED And GUICtrlRead($cb4) = $GUI_CHECKED And GUICtrlRead($cb5) = $GUI_CHECKED And GUICtrlRead($cb6) = $GUI_CHECKED And GUICtrlRead($cb7) = $GUI_CHECKED And GUICtrlRead($cb8) = $GUI_CHECKED Then

ShellExecute("C:\Users\%username%\Desktop\C1RepairUtility\Files\Scripts\Batch\Scan.cmd",$CommandLine)

Although, you could probably get rid of the whole batch file and just use AutoIt to run the program with the command line parameters this way.

Thank you for the reply!

With it setup like you suggested isn't only going to work when only one of the check boxes are selected at a time? Not when say like check boxes 2,5, and 7 are selected? Because I have created all 8 if statements but it only works when one checkbox is used.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Show me what you came up with, because I'm sure you set it up incorrectly.

EDIT: Also, please post a runnable script and not just the function to check the checkbox's state.

Edited by BrewManNH

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

Show me what you came up with, because I'm sure you set it up incorrectly.

EDIT: Also, please post a runnable script and not just the function to check the checkbox's state.

 

I am sure I did too haha, here is my full script:

#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <FontConstants.au3>
#include <MsgBoxConstants.au3>
#include <ColorConstants.au3>
#include <GuiMenu.au3>
#include <Process.au3>
;#RequireAdmin
Global $hButton1, $hButton2, $hButton3, $hButton4, $hButton5, $hButton6, $hGUI1, $ok
Global $hGui2, $Gui2MenuFile, $Gui2FileExit, $Gui2MenuHelp, $Gui2MenuAbout, $Gui2MenuInfo
Global $scan,$update,$vquar,$dquar, $all,$none
Global $cb1, $cb2, $cb3, $cb4, $cb5, $cb6, $cb7, $cb8
gui1()

Func gui1()
    Local $msg

    $hGUI1 = GUICreate("C1 Repair Utility") ; will create a dialog box that when displayed is centered
    $Gui1MenuFile = GUICtrlCreateMenu("&File")
    GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
    $Gui1FileExit = GUICtrlCreateMenuItem("Exit", $Gui1MenuFile)
    GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
    $Gui1MenuHelp = GUICtrlCreateMenu("&Help")
    GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
    $Gui1MenuAbout = GUICtrlCreateMenuItem("About", $Gui1MenuHelp)
    GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
    $Gui1MenuInfo = GUICtrlCreateMenuItem("Malwarebytes Info", $Gui1MenuHelp)
    GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function

    GUISetBkColor(0xFFFFFFF)
    GUISetFont(9, 300)

    GUICtrlCreateTab(10, 10, 382, 360)
    GUICtrlCreateTab(10, 10, 382, 360)

    GUICtrlCreateTabItem("Malware Removal")
    GUICtrlSetState(-1, $GUI_SHOW) ; will be display first
    ;GUICtrlCreateCombo("", 110, 50, 150, 120)
    ;GUICtrlSetData(-1, "Quickscan|QuickScanTerminate|FullScan|FullScanTerminate|RunUpdate|FullAuto", "RunUpdate") ; default Update
    ;GUICtrlCreateLabel("Malwarebytes", 20, 50, 80, 20)
    $hButton1 = GUICtrlCreateButton("Emsisoft CMD", 25, 50, 90, 20)
    GUICtrlSetOnEvent(-1, "On_Button")
    $hButton2 = GUICtrlCreateButton("SAS", 25, 80, 90, 20)
    GUICtrlSetOnEvent(-1, "On_Button")

    GUICtrlCreateTabItem("Maintenance")
    GUICtrlCreateLabel("label1", 30, 80, 50, 20)
    $ok = GUICtrlCreateButton("OK1", 80, 50, 50, 20)

    GUICtrlCreateTabItem("Repairs")

    GUICtrlCreateTabItem("") ; end tabitem definition

    GUICtrlCreateLabel("", 20, 130, 50, 20)

    GUISetState(@SW_SHOW)

    ; Loop until the user exits.
    While 1
        $aMsg = GUIGetMsg(1) ; Use advanced parameter to get array
        Switch $aMsg[1] ; check which GUI sent the message
            Case $hGUI1
                Switch $aMsg[0] ; Now check for the messages for $hGUI1
                    Case $GUI_EVENT_CLOSE ; If we get the CLOSE message from this GUI - we exit <<<<<<<<<<<<<<<
                        ExitLoop
                    Case $Gui1MenuFile
                    Case $Gui1FileExit
                        Exit
                    Case $Gui1MenuHelp
                    Case $Gui1MenuAbout
                        MsgBox(64, "About", "C1 Setup Utility®" & @CRLF & "Version 3.0" & @CRLF & @CRLF & @CRLF & "Created by Mike Swatek" & @CRLF & "©2014 Composites One. All rights reserved.")
                    Case $Gui1MenuInfo
                        ShellExecute(@DesktopDir & "\C1SetupUtility\Files\Scripts\HostTable.txt")
                    Case $hButton1
                          gui2()
                    Case $hButton2
                        MsgBox(0,"Info","You pressed SAS and it worked!")
                    Case $ok
                        MsgBox(0,"Info","You pressed OK from tab 2 and it worked!")
                    Case $hButton4
                        GUICtrlSetState($hButton4, $GUI_DISABLE)
                        gui2()
                    Case $hButton5
                        RunAs("Administrator", "", "franklin", "", @DesktopDir & "\C1SetupUtility\Files\Programs\Software\myuninst.exe")
                    Case $hButton6
                        ShellExecuteWait(@DesktopDir & "\C1SetupUtility\Files\Programs\Other\1.bat", "", @SW_SHOW)
                        ShellExecute("C:\Users\%username%\Desktop\C1SetupUtility\Files\Programs\Other\Full.cmd")
                EndSwitch
        Case $hGUI2
                Switch $aMsg[0] ; Now check for the messages for $hGUI1
                    Case $GUI_EVENT_CLOSE ; If we get the CLOSE message from this GUI - we exit <<<<<<<<<<<<<<<
                        GUIDelete($hGUI2)
                    Case $Gui2MenuFile
                    Case $Gui2FileExit
                        GUIDelete($hGUI2)
                    Case $Gui2MenuHelp
                    Case $Gui2MenuAbout
                        MsgBox(64, "About", "C1 Setup Utility®" & @CRLF & "Version 3.0" & @CRLF & @CRLF & @CRLF & "Created by Mike Swatek" & @CRLF & "©2014 Composites One. All rights reserved.")
                    Case $Gui1MenuInfo
                        ShellExecute(@DesktopDir & "\C1SetupUtility\Files\Scripts\HostTable.txt")
                    Case $update
                          ShellExecute("C:\Users\mswatek\Desktop\C1RepairUtility\Files\Scripts\Batch\EEKUpdate.bat")
                    Case $all
                        GUICtrlSetState($cb1,$GUI_CHECKED)
                        GUICtrlSetState($cb2,$GUI_CHECKED)
                        GUICtrlSetState($cb3,$GUI_CHECKED)
                        GUICtrlSetState($cb4,$GUI_CHECKED)
                        GUICtrlSetState($cb5,$GUI_CHECKED)
                        GUICtrlSetState($cb6,$GUI_CHECKED)
                        GUICtrlSetState($cb7,$GUI_CHECKED)
                        GUICtrlSetState($cb8,$GUI_CHECKED)
                    Case $none
                        GUICtrlSetState($cb1,$GUI_UNCHECKED)
                        GUICtrlSetState($cb2,$GUI_UNCHECKED)
                        GUICtrlSetState($cb3,$GUI_UNCHECKED)
                        GUICtrlSetState($cb4,$GUI_UNCHECKED)
                        GUICtrlSetState($cb5,$GUI_UNCHECKED)
                        GUICtrlSetState($cb6,$GUI_UNCHECKED)
                        GUICtrlSetState($cb7,$GUI_UNCHECKED)
                        GUICtrlSetState($cb8,$GUI_UNCHECKED)
                    Case $scan
                        scan()
                EndSwitch
        EndSwitch
    WEnd
    EndFunc


Func gui2()
$hGui2 = GUICreate("Emsisoft CMD Scanner", 398, 180, 758, 328)
$Gui2MenuFile = GUICtrlCreateMenu("&File")
GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
$Gui2FileExit = GUICtrlCreateMenuItem("Exit", $Gui2MenuFile)
GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
$Gui2MenuHelp = GUICtrlCreateMenu("&Help")
GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
$Gui2MenuAbout = GUICtrlCreateMenuItem("About", $Gui2MenuHelp)
GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
$Gui2MenuInfo = GUICtrlCreateMenuItem("Malwarebytes Info", $Gui2MenuHelp)
GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
$Pic1 = GUICtrlCreatePic("C:\Users\mswatek\Desktop\C1RepairUtility\Files\Tools\BG.jpg", 0, 0, 397, 177)
GUICtrlSetState($Pic1, $GUI_DISABLE)
$Label1 = GUICtrlCreateLabel("Emsisoft CMD scanner", 100, 8, 240, 22)
GUICtrlSetBkColor(-1, 0xC0C0C0)
GUICtrlSetFont(-1, 14, 800, 0, "Terminal")
GUICtrlSetColor(-1, 0x0000FF)
$update = GUICtrlCreateButton("Update", 32, 48, 75, 25)
GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
$vquar = GUICtrlCreateButton("View QUAR", 32, 88, 75, 25)
GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
$dquar = GUICtrlCreateButton("Delete QUAR", 32, 128, 75, 25)
GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
$cb1 = GUICtrlCreateCheckbox("Quick", 136, 48, 49, 17)
GUICtrlSetBkColor(-1, 0xC0C0C0)
$cb2 = GUICtrlCreateCheckbox("Smart", 192, 48, 49, 17)
GUICtrlSetBkColor(-1, 0xC0C0C0)
$cb3 = GUICtrlCreateCheckbox("Deep", 248, 48, 49, 17)
GUICtrlSetBkColor(-1, 0xC0C0C0)
$cb4 = GUICtrlCreateCheckbox("RootKit", 248, 72, 58, 17)
GUICtrlSetBkColor(-1, 0xC0C0C0)
$cb5 = GUICtrlCreateCheckbox("Memory", 224, 96, 58, 17)
GUICtrlSetBkColor(-1, 0xC0C0C0)
$cb6 = GUICtrlCreateCheckbox("Traces", 192, 72, 50, 17)
GUICtrlSetBkColor(-1, 0xC0C0C0)
$cb7 = GUICtrlCreateCheckbox("Cookies", 160, 96, 55, 17)
GUICtrlSetBkColor(-1, 0xC0C0C0)
$cb8 = GUICtrlCreateCheckbox("PUP", 136, 72, 41, 17)
GUICtrlSetBkColor(-1, 0xC0C0C0)
$all = GUICtrlCreateButton("All", 320, 48, 51, 17)
GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
$none = GUICtrlCreateButton("None", 320, 72, 51, 17)
GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
$scan = GUICtrlCreateButton("Scan", 176, 128, 75, 25)
GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
GUISetState()
EndFunc

func scan()
Opt("ExpandEnvStrings", 1)
Global $quick = "/quick", $smart = "/smart", $deep = "/deep", $rootkit = "/rk", $memory = "/memory", $traces = "/traces", $cookies = "/cookies", $pup = "/pup"
$CommandLine = '"'
If GUICtrlRead($cb1) = $GUI_CHECKED Then
    $CommandLine &= $quick & '" "'
EndIf
If GUICtrlRead($cb2) = $GUI_CHECKED Then
    $CommandLine &= $smart & '" "'
EndIf
If GUICtrlRead($cb3) = $GUI_CHECKED Then
    $CommandLine &= $deep & '" "'
EndIf
If GUICtrlRead($cb4) = $GUI_CHECKED Then
    $CommandLine &= $rootkit & '" "'
EndIf
If GUICtrlRead($cb5) = $GUI_CHECKED Then
    $CommandLine &= $memory & '" "'
EndIf
If GUICtrlRead($cb6) = $GUI_CHECKED Then
    $CommandLine &= $traces & '" "'
EndIf
If GUICtrlRead($cb7) = $GUI_CHECKED Then
    $CommandLine &= $cookies & '" "'
EndIf
If GUICtrlRead($cb8) = $GUI_CHECKED Then
    $CommandLine &= $pup & '" "'
EndIf
$CommandLine = StringLeft($CommandLine, StringLen($CommandLine) - 3) & '"'
ShellExecute("C:\Users\%username%\Desktop\C1RepairUtility\Files\Scripts\Batch\Scan.cmd",$CommandLine)
EndFunc

Share this post


Link to post
Share on other sites

I looked at your code, and other than mixing OnEvent mode and message loop mode it should work ok. Although once I saw what exactly the code intends I have modified it a bit to probably work better.

Try this and see if it works for you. When you run it and select some of the checkboxes, you'll see that the $CommandLine variable holds the correct text. I commented out the shellexecute so it won't run anything as is.

#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <FontConstants.au3>
#include <MsgBoxConstants.au3>
#include <ColorConstants.au3>
#include <GuiMenu.au3>
#include <Process.au3>
;#RequireAdmin
Global $hButton1, $hButton2, $hButton3, $hButton4, $hButton5, $hButton6, $hGUI1, $ok
Global $hGui2, $Gui2MenuFile, $Gui2FileExit, $Gui2MenuHelp, $Gui2MenuAbout, $Gui2MenuInfo
Global $scan, $update, $vquar, $dquar, $all, $none
Global $cb1, $cb2, $cb3, $cb4, $cb5, $cb6, $cb7, $cb8
gui1()

Func gui1()
    Local $msg

    $hGUI1 = GUICreate("C1 Repair Utility") ; will create a dialog box that when displayed is centered
    $Gui1MenuFile = GUICtrlCreateMenu("&File")
;~  GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
    $Gui1FileExit = GUICtrlCreateMenuItem("Exit", $Gui1MenuFile)
;~  GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
    $Gui1MenuHelp = GUICtrlCreateMenu("&Help")
;~  GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
    $Gui1MenuAbout = GUICtrlCreateMenuItem("About", $Gui1MenuHelp)
;~  GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
    $Gui1MenuInfo = GUICtrlCreateMenuItem("Malwarebytes Info", $Gui1MenuHelp)
;~  GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function

    GUISetBkColor(0xFFFFFFF)
    GUISetFont(9, 300)

    GUICtrlCreateTab(10, 10, 382, 360)
    GUICtrlCreateTab(10, 10, 382, 360)

    GUICtrlCreateTabItem("Malware Removal")
    GUICtrlSetState(-1, $GUI_SHOW) ; will be display first
    ;GUICtrlCreateCombo("", 110, 50, 150, 120)
    ;GUICtrlSetData(-1, "Quickscan|QuickScanTerminate|FullScan|FullScanTerminate|RunUpdate|FullAuto", "RunUpdate") ; default Update
    ;GUICtrlCreateLabel("Malwarebytes", 20, 50, 80, 20)
    $hButton1 = GUICtrlCreateButton("Emsisoft CMD", 25, 50, 90, 20)
;~  GUICtrlSetOnEvent(-1, "On_Button")
    $hButton2 = GUICtrlCreateButton("SAS", 25, 80, 90, 20)
;~  GUICtrlSetOnEvent(-1, "On_Button")

    GUICtrlCreateTabItem("Maintenance")
    GUICtrlCreateLabel("label1", 30, 80, 50, 20)
    $ok = GUICtrlCreateButton("OK1", 80, 50, 50, 20)

    GUICtrlCreateTabItem("Repairs")

    GUICtrlCreateTabItem("") ; end tabitem definition

    GUICtrlCreateLabel("", 20, 130, 50, 20)

    GUISetState(@SW_SHOW)

    ; Loop until the user exits.
    While 1
        $aMsg = GUIGetMsg(1) ; Use advanced parameter to get array
        Switch $aMsg[1] ; check which GUI sent the message
            Case $hGUI1
                Switch $aMsg[0] ; Now check for the messages for $hGUI1
                    Case $GUI_EVENT_CLOSE ; If we get the CLOSE message from this GUI - we exit <<<<<<<<<<<<<<<
                        ExitLoop
                    Case $Gui1MenuFile
                    Case $Gui1FileExit
                        Exit
                    Case $Gui1MenuHelp
                    Case $Gui1MenuAbout
                        MsgBox(64, "About", "C1 Setup Utility®" & @CRLF & "Version 3.0" & @CRLF & @CRLF & @CRLF & "Created by Mike Swatek" & @CRLF & "©2014 Composites One. All rights reserved.")
                    Case $Gui1MenuInfo
                        ShellExecute(@DesktopDir & "\C1SetupUtility\Files\Scripts\HostTable.txt")
                    Case $hButton1
                        gui2()
                    Case $hButton2
                        MsgBox(0, "Info", "You pressed SAS and it worked!")
                    Case $ok
                        MsgBox(0, "Info", "You pressed OK from tab 2 and it worked!")
                    Case $hButton4
                        GUICtrlSetState($hButton4, $GUI_DISABLE)
                        gui2()
                    Case $hButton5
                        RunAs("Administrator", "", "franklin", "", @DesktopDir & "\C1SetupUtility\Files\Programs\Software\myuninst.exe")
                    Case $hButton6
                        ShellExecuteWait(@DesktopDir & "\C1SetupUtility\Files\Programs\Other\1.bat", "", @SW_SHOW)
                        ShellExecute("C:\Users\%username%\Desktop\C1SetupUtility\Files\Programs\Other\Full.cmd")
                EndSwitch
            Case $hGUI2
                Switch $aMsg[0] ; Now check for the messages for $hGUI1
                    Case $GUI_EVENT_CLOSE ; If we get the CLOSE message from this GUI - we exit <<<<<<<<<<<<<<<
                        GUIDelete($hGUI2)
                    Case $Gui2MenuFile
                    Case $Gui2FileExit
                        GUIDelete($hGUI2)
                    Case $Gui2MenuHelp
                    Case $Gui2MenuAbout
                        MsgBox(64, "About", "C1 Setup Utility®" & @CRLF & "Version 3.0" & @CRLF & @CRLF & @CRLF & "Created by Mike Swatek" & @CRLF & "©2014 Composites One. All rights reserved.")
                    Case $Gui1MenuInfo
                        ShellExecute(@DesktopDir & "\C1SetupUtility\Files\Scripts\HostTable.txt")
                    Case $update
                        ShellExecute("C:\Users\mswatek\Desktop\C1RepairUtility\Files\Scripts\Batch\EEKUpdate.bat")
                    Case $all
                        GUICtrlSetState($cb1, $GUI_CHECKED)
                        GUICtrlSetState($cb2, $GUI_CHECKED)
                        GUICtrlSetState($cb3, $GUI_CHECKED)
                        GUICtrlSetState($cb4, $GUI_CHECKED)
                        GUICtrlSetState($cb5, $GUI_CHECKED)
                        GUICtrlSetState($cb6, $GUI_CHECKED)
                        GUICtrlSetState($cb7, $GUI_CHECKED)
                        GUICtrlSetState($cb8, $GUI_CHECKED)
                    Case $none
                        GUICtrlSetState($cb1, $GUI_UNCHECKED)
                        GUICtrlSetState($cb2, $GUI_UNCHECKED)
                        GUICtrlSetState($cb3, $GUI_UNCHECKED)
                        GUICtrlSetState($cb4, $GUI_UNCHECKED)
                        GUICtrlSetState($cb5, $GUI_UNCHECKED)
                        GUICtrlSetState($cb6, $GUI_UNCHECKED)
                        GUICtrlSetState($cb7, $GUI_UNCHECKED)
                        GUICtrlSetState($cb8, $GUI_UNCHECKED)
                    Case $scan
                        scan()
                EndSwitch
        EndSwitch
    WEnd
EndFunc   ;==>gui1


Func gui2()
    $hGui2 = GUICreate("Emsisoft CMD Scanner", 398, 180, 758, 328)
    $Gui2MenuFile = GUICtrlCreateMenu("&File")
;~  GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
    $Gui2FileExit = GUICtrlCreateMenuItem("Exit", $Gui2MenuFile)
;~  GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
    $Gui2MenuHelp = GUICtrlCreateMenu("&Help")
;~  GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
    $Gui2MenuAbout = GUICtrlCreateMenuItem("About", $Gui2MenuHelp)
;~  GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
    $Gui2MenuInfo = GUICtrlCreateMenuItem("Malwarebytes Info", $Gui2MenuHelp)
;~  GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
    $Pic1 = GUICtrlCreatePic("C:\Users\mswatek\Desktop\C1RepairUtility\Files\Tools\BG.jpg", 0, 0, 397, 177)
    GUICtrlSetState($Pic1, $GUI_DISABLE)
    $Label1 = GUICtrlCreateLabel("Emsisoft CMD scanner", 100, 8, 240, 22)
    GUICtrlSetBkColor(-1, 0xC0C0C0)
    GUICtrlSetFont(-1, 14, 800, 0, "Terminal")
    GUICtrlSetColor(-1, 0x0000FF)
    $update = GUICtrlCreateButton("Update", 32, 48, 75, 25)
;~  GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
    $vquar = GUICtrlCreateButton("View QUAR", 32, 88, 75, 25)
;~  GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
    $dquar = GUICtrlCreateButton("Delete QUAR", 32, 128, 75, 25)
;~  GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
    $cb1 = GUICtrlCreateCheckbox("Quick", 136, 48, 49, 17)
    GUICtrlSetBkColor(-1, 0xC0C0C0)
    $cb2 = GUICtrlCreateCheckbox("Smart", 192, 48, 49, 17)
    GUICtrlSetBkColor(-1, 0xC0C0C0)
    $cb3 = GUICtrlCreateCheckbox("Deep", 248, 48, 49, 17)
    GUICtrlSetBkColor(-1, 0xC0C0C0)
    $cb4 = GUICtrlCreateCheckbox("RootKit", 248, 72, 58, 17)
    GUICtrlSetBkColor(-1, 0xC0C0C0)
    $cb5 = GUICtrlCreateCheckbox("Memory", 224, 96, 58, 17)
    GUICtrlSetBkColor(-1, 0xC0C0C0)
    $cb6 = GUICtrlCreateCheckbox("Traces", 192, 72, 50, 17)
    GUICtrlSetBkColor(-1, 0xC0C0C0)
    $cb7 = GUICtrlCreateCheckbox("Cookies", 160, 96, 55, 17)
    GUICtrlSetBkColor(-1, 0xC0C0C0)
    $cb8 = GUICtrlCreateCheckbox("PUP", 136, 72, 41, 17)
    GUICtrlSetBkColor(-1, 0xC0C0C0)
    $all = GUICtrlCreateButton("All", 320, 48, 51, 17)
;~  GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
    $none = GUICtrlCreateButton("None", 320, 72, 51, 17)
;~  GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
    $scan = GUICtrlCreateButton("Scan", 176, 128, 75, 25)
;~  GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
    GUISetState()
EndFunc   ;==>gui2

Func scan()
    Opt("ExpandEnvStrings", 1)
    Global $quick = "/quick", $smart = "/smart", $deep = "/deep", $rootkit = "/rk", $memory = "/memory", $traces = "/traces", $cookies = "/cookies", $pup = "/pup"
    $CommandLine = '"'
    If GUICtrlRead($cb1) = $GUI_CHECKED Then
        $CommandLine &= $quick & ' '
    EndIf
    If GUICtrlRead($cb2) = $GUI_CHECKED Then
        $CommandLine &= $smart & ' '
    EndIf
    If GUICtrlRead($cb3) = $GUI_CHECKED Then
        $CommandLine &= $deep & ' '
    EndIf
    If GUICtrlRead($cb4) = $GUI_CHECKED Then
        $CommandLine &= $rootkit & ' '
    EndIf
    If GUICtrlRead($cb5) = $GUI_CHECKED Then
        $CommandLine &= $memory & ' '
    EndIf
    If GUICtrlRead($cb6) = $GUI_CHECKED Then
        $CommandLine &= $traces & ' '
    EndIf
    If GUICtrlRead($cb7) = $GUI_CHECKED Then
        $CommandLine &= $cookies & ' '
    EndIf
    If GUICtrlRead($cb8) = $GUI_CHECKED Then
        $CommandLine &= $pup & ' '
    EndIf
    $CommandLine = StringLeft($CommandLine, StringLen($CommandLine) - 1) & '"'
    ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $CommandLine = ' & $CommandLine & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console
;~  ShellExecute("C:\Users\%username%\Desktop\C1RepairUtility\Files\Scripts\Batch\Scan.cmd", $CommandLine)
EndFunc   ;==>scan

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

 

I looked at your code, and other than mixing OnEvent mode and message loop mode it should work ok. Although once I saw what exactly the code intends I have modified it a bit to probably work better.

Try this and see if it works for you. When you run it and select some of the checkboxes, you'll see that the $CommandLine variable holds the correct text. I commented out the shellexecute so it won't run anything as is.

#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <FontConstants.au3>
#include <MsgBoxConstants.au3>
#include <ColorConstants.au3>
#include <GuiMenu.au3>
#include <Process.au3>
;#RequireAdmin
Global $hButton1, $hButton2, $hButton3, $hButton4, $hButton5, $hButton6, $hGUI1, $ok
Global $hGui2, $Gui2MenuFile, $Gui2FileExit, $Gui2MenuHelp, $Gui2MenuAbout, $Gui2MenuInfo
Global $scan, $update, $vquar, $dquar, $all, $none
Global $cb1, $cb2, $cb3, $cb4, $cb5, $cb6, $cb7, $cb8
gui1()

Func gui1()
    Local $msg

    $hGUI1 = GUICreate("C1 Repair Utility") ; will create a dialog box that when displayed is centered
    $Gui1MenuFile = GUICtrlCreateMenu("&File")
;~  GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
    $Gui1FileExit = GUICtrlCreateMenuItem("Exit", $Gui1MenuFile)
;~  GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
    $Gui1MenuHelp = GUICtrlCreateMenu("&Help")
;~  GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
    $Gui1MenuAbout = GUICtrlCreateMenuItem("About", $Gui1MenuHelp)
;~  GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
    $Gui1MenuInfo = GUICtrlCreateMenuItem("Malwarebytes Info", $Gui1MenuHelp)
;~  GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function

    GUISetBkColor(0xFFFFFFF)
    GUISetFont(9, 300)

    GUICtrlCreateTab(10, 10, 382, 360)
    GUICtrlCreateTab(10, 10, 382, 360)

    GUICtrlCreateTabItem("Malware Removal")
    GUICtrlSetState(-1, $GUI_SHOW) ; will be display first
    ;GUICtrlCreateCombo("", 110, 50, 150, 120)
    ;GUICtrlSetData(-1, "Quickscan|QuickScanTerminate|FullScan|FullScanTerminate|RunUpdate|FullAuto", "RunUpdate") ; default Update
    ;GUICtrlCreateLabel("Malwarebytes", 20, 50, 80, 20)
    $hButton1 = GUICtrlCreateButton("Emsisoft CMD", 25, 50, 90, 20)
;~  GUICtrlSetOnEvent(-1, "On_Button")
    $hButton2 = GUICtrlCreateButton("SAS", 25, 80, 90, 20)
;~  GUICtrlSetOnEvent(-1, "On_Button")

    GUICtrlCreateTabItem("Maintenance")
    GUICtrlCreateLabel("label1", 30, 80, 50, 20)
    $ok = GUICtrlCreateButton("OK1", 80, 50, 50, 20)

    GUICtrlCreateTabItem("Repairs")

    GUICtrlCreateTabItem("") ; end tabitem definition

    GUICtrlCreateLabel("", 20, 130, 50, 20)

    GUISetState(@SW_SHOW)

    ; Loop until the user exits.
    While 1
        $aMsg = GUIGetMsg(1) ; Use advanced parameter to get array
        Switch $aMsg[1] ; check which GUI sent the message
            Case $hGUI1
                Switch $aMsg[0] ; Now check for the messages for $hGUI1
                    Case $GUI_EVENT_CLOSE ; If we get the CLOSE message from this GUI - we exit <<<<<<<<<<<<<<<
                        ExitLoop
                    Case $Gui1MenuFile
                    Case $Gui1FileExit
                        Exit
                    Case $Gui1MenuHelp
                    Case $Gui1MenuAbout
                        MsgBox(64, "About", "C1 Setup Utility®" & @CRLF & "Version 3.0" & @CRLF & @CRLF & @CRLF & "Created by Mike Swatek" & @CRLF & "©2014 Composites One. All rights reserved.")
                    Case $Gui1MenuInfo
                        ShellExecute(@DesktopDir & "\C1SetupUtility\Files\Scripts\HostTable.txt")
                    Case $hButton1
                        gui2()
                    Case $hButton2
                        MsgBox(0, "Info", "You pressed SAS and it worked!")
                    Case $ok
                        MsgBox(0, "Info", "You pressed OK from tab 2 and it worked!")
                    Case $hButton4
                        GUICtrlSetState($hButton4, $GUI_DISABLE)
                        gui2()
                    Case $hButton5
                        RunAs("Administrator", "", "franklin", "", @DesktopDir & "\C1SetupUtility\Files\Programs\Software\myuninst.exe")
                    Case $hButton6
                        ShellExecuteWait(@DesktopDir & "\C1SetupUtility\Files\Programs\Other\1.bat", "", @SW_SHOW)
                        ShellExecute("C:\Users\%username%\Desktop\C1SetupUtility\Files\Programs\Other\Full.cmd")
                EndSwitch
            Case $hGUI2
                Switch $aMsg[0] ; Now check for the messages for $hGUI1
                    Case $GUI_EVENT_CLOSE ; If we get the CLOSE message from this GUI - we exit <<<<<<<<<<<<<<<
                        GUIDelete($hGUI2)
                    Case $Gui2MenuFile
                    Case $Gui2FileExit
                        GUIDelete($hGUI2)
                    Case $Gui2MenuHelp
                    Case $Gui2MenuAbout
                        MsgBox(64, "About", "C1 Setup Utility®" & @CRLF & "Version 3.0" & @CRLF & @CRLF & @CRLF & "Created by Mike Swatek" & @CRLF & "©2014 Composites One. All rights reserved.")
                    Case $Gui1MenuInfo
                        ShellExecute(@DesktopDir & "\C1SetupUtility\Files\Scripts\HostTable.txt")
                    Case $update
                        ShellExecute("C:\Users\mswatek\Desktop\C1RepairUtility\Files\Scripts\Batch\EEKUpdate.bat")
                    Case $all
                        GUICtrlSetState($cb1, $GUI_CHECKED)
                        GUICtrlSetState($cb2, $GUI_CHECKED)
                        GUICtrlSetState($cb3, $GUI_CHECKED)
                        GUICtrlSetState($cb4, $GUI_CHECKED)
                        GUICtrlSetState($cb5, $GUI_CHECKED)
                        GUICtrlSetState($cb6, $GUI_CHECKED)
                        GUICtrlSetState($cb7, $GUI_CHECKED)
                        GUICtrlSetState($cb8, $GUI_CHECKED)
                    Case $none
                        GUICtrlSetState($cb1, $GUI_UNCHECKED)
                        GUICtrlSetState($cb2, $GUI_UNCHECKED)
                        GUICtrlSetState($cb3, $GUI_UNCHECKED)
                        GUICtrlSetState($cb4, $GUI_UNCHECKED)
                        GUICtrlSetState($cb5, $GUI_UNCHECKED)
                        GUICtrlSetState($cb6, $GUI_UNCHECKED)
                        GUICtrlSetState($cb7, $GUI_UNCHECKED)
                        GUICtrlSetState($cb8, $GUI_UNCHECKED)
                    Case $scan
                        scan()
                EndSwitch
        EndSwitch
    WEnd
EndFunc   ;==>gui1


Func gui2()
    $hGui2 = GUICreate("Emsisoft CMD Scanner", 398, 180, 758, 328)
    $Gui2MenuFile = GUICtrlCreateMenu("&File")
;~  GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
    $Gui2FileExit = GUICtrlCreateMenuItem("Exit", $Gui2MenuFile)
;~  GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
    $Gui2MenuHelp = GUICtrlCreateMenu("&Help")
;~  GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
    $Gui2MenuAbout = GUICtrlCreateMenuItem("About", $Gui2MenuHelp)
;~  GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
    $Gui2MenuInfo = GUICtrlCreateMenuItem("Malwarebytes Info", $Gui2MenuHelp)
;~  GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
    $Pic1 = GUICtrlCreatePic("C:\Users\mswatek\Desktop\C1RepairUtility\Files\Tools\BG.jpg", 0, 0, 397, 177)
    GUICtrlSetState($Pic1, $GUI_DISABLE)
    $Label1 = GUICtrlCreateLabel("Emsisoft CMD scanner", 100, 8, 240, 22)
    GUICtrlSetBkColor(-1, 0xC0C0C0)
    GUICtrlSetFont(-1, 14, 800, 0, "Terminal")
    GUICtrlSetColor(-1, 0x0000FF)
    $update = GUICtrlCreateButton("Update", 32, 48, 75, 25)
;~  GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
    $vquar = GUICtrlCreateButton("View QUAR", 32, 88, 75, 25)
;~  GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
    $dquar = GUICtrlCreateButton("Delete QUAR", 32, 128, 75, 25)
;~  GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
    $cb1 = GUICtrlCreateCheckbox("Quick", 136, 48, 49, 17)
    GUICtrlSetBkColor(-1, 0xC0C0C0)
    $cb2 = GUICtrlCreateCheckbox("Smart", 192, 48, 49, 17)
    GUICtrlSetBkColor(-1, 0xC0C0C0)
    $cb3 = GUICtrlCreateCheckbox("Deep", 248, 48, 49, 17)
    GUICtrlSetBkColor(-1, 0xC0C0C0)
    $cb4 = GUICtrlCreateCheckbox("RootKit", 248, 72, 58, 17)
    GUICtrlSetBkColor(-1, 0xC0C0C0)
    $cb5 = GUICtrlCreateCheckbox("Memory", 224, 96, 58, 17)
    GUICtrlSetBkColor(-1, 0xC0C0C0)
    $cb6 = GUICtrlCreateCheckbox("Traces", 192, 72, 50, 17)
    GUICtrlSetBkColor(-1, 0xC0C0C0)
    $cb7 = GUICtrlCreateCheckbox("Cookies", 160, 96, 55, 17)
    GUICtrlSetBkColor(-1, 0xC0C0C0)
    $cb8 = GUICtrlCreateCheckbox("PUP", 136, 72, 41, 17)
    GUICtrlSetBkColor(-1, 0xC0C0C0)
    $all = GUICtrlCreateButton("All", 320, 48, 51, 17)
;~  GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
    $none = GUICtrlCreateButton("None", 320, 72, 51, 17)
;~  GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
    $scan = GUICtrlCreateButton("Scan", 176, 128, 75, 25)
;~  GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function
    GUISetState()
EndFunc   ;==>gui2

Func scan()
    Opt("ExpandEnvStrings", 1)
    Global $quick = "/quick", $smart = "/smart", $deep = "/deep", $rootkit = "/rk", $memory = "/memory", $traces = "/traces", $cookies = "/cookies", $pup = "/pup"
    $CommandLine = '"'
    If GUICtrlRead($cb1) = $GUI_CHECKED Then
        $CommandLine &= $quick & ' '
    EndIf
    If GUICtrlRead($cb2) = $GUI_CHECKED Then
        $CommandLine &= $smart & ' '
    EndIf
    If GUICtrlRead($cb3) = $GUI_CHECKED Then
        $CommandLine &= $deep & ' '
    EndIf
    If GUICtrlRead($cb4) = $GUI_CHECKED Then
        $CommandLine &= $rootkit & ' '
    EndIf
    If GUICtrlRead($cb5) = $GUI_CHECKED Then
        $CommandLine &= $memory & ' '
    EndIf
    If GUICtrlRead($cb6) = $GUI_CHECKED Then
        $CommandLine &= $traces & ' '
    EndIf
    If GUICtrlRead($cb7) = $GUI_CHECKED Then
        $CommandLine &= $cookies & ' '
    EndIf
    If GUICtrlRead($cb8) = $GUI_CHECKED Then
        $CommandLine &= $pup & ' '
    EndIf
    $CommandLine = StringLeft($CommandLine, StringLen($CommandLine) - 1) & '"'
    ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $CommandLine = ' & $CommandLine & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console
;~  ShellExecute("C:\Users\%username%\Desktop\C1RepairUtility\Files\Scripts\Batch\Scan.cmd", $CommandLine)
EndFunc   ;==>scan

Works perfectly! Thank you for your help!

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  
Followers 0