Jump to content

Recommended Posts

Posted

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 426, 236, 281, 146)
$Label1 = GUICtrlCreateLabel("Deep Freeze Silent Installation", 16, 8, 222, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Checkbox1 = GUICtrlCreateCheckbox("A:", 24, 40, 33, 25)
$Checkbox2 = GUICtrlCreateCheckbox("C:", 24, 88, 33, 25)
$Checkbox3 = GUICtrlCreateCheckbox("B:", 24, 64, 33, 25)
$Checkbox4 = GUICtrlCreateCheckbox("D:", 24, 112, 33, 25)
$Checkbox5 = GUICtrlCreateCheckbox("E:", 24, 136, 33, 25)
$Checkbox6 = GUICtrlCreateCheckbox("F:", 24, 160, 33, 25)
$Checkbox7 = GUICtrlCreateCheckbox("L:", 72, 160, 33, 25)
$Checkbox8 = GUICtrlCreateCheckbox("G:", 72, 40, 33, 25)
$Checkbox9 = GUICtrlCreateCheckbox("H:", 72, 64, 33, 25)
$Checkbox10 = GUICtrlCreateCheckbox("I:", 72, 88, 33, 25)
$Checkbox11 = GUICtrlCreateCheckbox("J:", 72, 112, 33, 25)
$Checkbox12 = GUICtrlCreateCheckbox("K:", 72, 136, 33, 25)
$Checkbox13 = GUICtrlCreateCheckbox("L:", 120, 40, 33, 25)
$Checkbox14 = GUICtrlCreateCheckbox("N:", 120, 88, 33, 25)
$Checkbox15 = GUICtrlCreateCheckbox("M:", 120, 64, 33, 25)
$Checkbox16 = GUICtrlCreateCheckbox("O:", 120, 112, 33, 25)
$Checkbox17 = GUICtrlCreateCheckbox("P:", 120, 136, 33, 25)
$Checkbox18 = GUICtrlCreateCheckbox("Q:", 120, 160, 33, 25)
$Checkbox19 = GUICtrlCreateCheckbox("W:", 168, 160, 33, 25)
$Checkbox20 = GUICtrlCreateCheckbox("R:", 168, 40, 33, 25)
$Checkbox21 = GUICtrlCreateCheckbox("S:", 168, 64, 33, 25)
$Checkbox22 = GUICtrlCreateCheckbox("T:", 168, 88, 33, 25)
$Checkbox23 = GUICtrlCreateCheckbox("U:", 168, 112, 33, 25)
$Checkbox24 = GUICtrlCreateCheckbox("V:", 168, 136, 33, 25)
$Checkbox25 = GUICtrlCreateCheckbox("X:", 208, 40, 33, 25)
$Checkbox26 = GUICtrlCreateCheckbox("W:", 208, 64, 33, 25)
$Checkbox27 = GUICtrlCreateCheckbox("Z:", 208, 88, 33, 25)
$install = GUICtrlCreateButton("Install", 24, 192, 81, 25)
$Button2 = GUICtrlCreateButton("Uninstall", 112, 192, 81, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $install
            _install()
    EndSwitch
WEnd

Func _install()
    ShellExecuteWait("DeepfreezeSetup.exe", '/install /Freeze=C,D,M,X') ; Freeze checked Disks
EndFunc

i want to write checked boxes in setup parameter.

Posted

I don't fully understand. Are you saying that you want to insert something into the Deepfreezesetup.exe command line as a parameter if a disk is checked? Can deepfreezesetup run simultaneously on multiple drives with just one command line call or do you have to run deepfreezesetup on each drive separately? I think you need an if statement or aĀ  for loop.

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Posted

I don't fully understand. Are you saying that you want to insert something into the Deepfreezesetup.exe command line as a parameter if a disk is checked? Can deepfreezesetup run simultaneously on multiple drives with just one command line call or do you have to run deepfreezesetup on each drive separately? I think you need an if statement or aĀ  for loop.

i want thisĀ ShellExecuteWait("DeepfreezeSetup.exe", '/install /Freeze=C,D,M,X') write /Freeze=Checked Disks like this: if C, M, B checked write /Freeze=C, M, B

Posted

Read under remarks in this link:

https://www.autoitscript.com/autoit3/docs/functions/GUICtrlCreateCheckbox.htm

"To obtain the value of the control see GUICtrlRead()."

I wont write the code for you but you need to us GUICtrlRead and the variable labels ($CheckBox1,$CheckBox2, etc))for your buttons and an if or for statement to implement this.

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Posted

Read under remarks in this link:

https://www.autoitscript.com/autoit3/docs/functions/GUICtrlCreateCheckbox.htm

"To obtain the value of the control see GUICtrlRead()."

I wont write the code for you but you need to us GUICtrlRead and the variable labels ($CheckBox1,$CheckBox2, etc))for your buttons and an if or for statement to implement this.

I know this. It doesn't help me. I think you dont understand my question.

Posted

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 426, 236, 281, 146)
$Label1 = GUICtrlCreateLabel("Deep Freeze Silent Installation", 16, 8, 222, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Checkbox1 = GUICtrlCreateCheckbox("A:", 24, 40, 33, 25)
$Checkbox2 = GUICtrlCreateCheckbox("C:", 24, 88, 33, 25)
$Checkbox3 = GUICtrlCreateCheckbox("B:", 24, 64, 33, 25)
$Checkbox4 = GUICtrlCreateCheckbox("D:", 24, 112, 33, 25)
$Checkbox5 = GUICtrlCreateCheckbox("E:", 24, 136, 33, 25)
$Checkbox6 = GUICtrlCreateCheckbox("F:", 24, 160, 33, 25)
$Checkbox7 = GUICtrlCreateCheckbox("L:", 72, 160, 33, 25)
$Checkbox8 = GUICtrlCreateCheckbox("G:", 72, 40, 33, 25)
$Checkbox9 = GUICtrlCreateCheckbox("H:", 72, 64, 33, 25)
$Checkbox10 = GUICtrlCreateCheckbox("I:", 72, 88, 33, 25)
$Checkbox11 = GUICtrlCreateCheckbox("J:", 72, 112, 33, 25)
$Checkbox12 = GUICtrlCreateCheckbox("K:", 72, 136, 33, 25)
$Checkbox13 = GUICtrlCreateCheckbox("L:", 120, 40, 33, 25)
$Checkbox14 = GUICtrlCreateCheckbox("N:", 120, 88, 33, 25)
$Checkbox15 = GUICtrlCreateCheckbox("M:", 120, 64, 33, 25)
$Checkbox16 = GUICtrlCreateCheckbox("O:", 120, 112, 33, 25)
$Checkbox17 = GUICtrlCreateCheckbox("P:", 120, 136, 33, 25)
$Checkbox18 = GUICtrlCreateCheckbox("Q:", 120, 160, 33, 25)
$Checkbox19 = GUICtrlCreateCheckbox("W:", 168, 160, 33, 25)
$Checkbox20 = GUICtrlCreateCheckbox("R:", 168, 40, 33, 25)
$Checkbox21 = GUICtrlCreateCheckbox("S:", 168, 64, 33, 25)
$Checkbox22 = GUICtrlCreateCheckbox("T:", 168, 88, 33, 25)
$Checkbox23 = GUICtrlCreateCheckbox("U:", 168, 112, 33, 25)
$Checkbox24 = GUICtrlCreateCheckbox("V:", 168, 136, 33, 25)
$Checkbox25 = GUICtrlCreateCheckbox("X:", 208, 40, 33, 25)
$Checkbox26 = GUICtrlCreateCheckbox("W:", 208, 64, 33, 25)
$Checkbox27 = GUICtrlCreateCheckbox("Z:", 208, 88, 33, 25)
$install = GUICtrlCreateButton("Install", 24, 192, 81, 25)
$Button2 = GUICtrlCreateButton("Uninstall", 112, 192, 81, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $install
            MsgBox(0,"State of Message Box ", $Checkbox1); <----------I changed this line
            ;_install()
    EndSwitch
WEnd

Func _install()
    ShellExecuteWait("DeepfreezeSetup.exe", '/install /Freeze=C,D,M,X') ; Freeze checked Disks
EndFunc

Put a check in the first check box and hit install. See the result. Then don't put a check in the box and hit install. See the result.

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Posted
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 426, 236, 281, 146)
$Label1 = GUICtrlCreateLabel("Deep Freeze Silent Installation", 16, 8, 222, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Checkbox1 = GUICtrlCreateCheckbox("A:", 24, 40, 33, 25)
$Checkbox2 = GUICtrlCreateCheckbox("C:", 24, 88, 33, 25)
$Checkbox3 = GUICtrlCreateCheckbox("B:", 24, 64, 33, 25)
$Checkbox4 = GUICtrlCreateCheckbox("D:", 24, 112, 33, 25)
$Checkbox5 = GUICtrlCreateCheckbox("E:", 24, 136, 33, 25)
$Checkbox6 = GUICtrlCreateCheckbox("F:", 24, 160, 33, 25)
$Checkbox7 = GUICtrlCreateCheckbox("L:", 72, 160, 33, 25)
$Checkbox8 = GUICtrlCreateCheckbox("G:", 72, 40, 33, 25)
$Checkbox9 = GUICtrlCreateCheckbox("H:", 72, 64, 33, 25)
$Checkbox10 = GUICtrlCreateCheckbox("I:", 72, 88, 33, 25)
$Checkbox11 = GUICtrlCreateCheckbox("J:", 72, 112, 33, 25)
$Checkbox12 = GUICtrlCreateCheckbox("K:", 72, 136, 33, 25)
$Checkbox13 = GUICtrlCreateCheckbox("L:", 120, 40, 33, 25)
$Checkbox14 = GUICtrlCreateCheckbox("N:", 120, 88, 33, 25)
$Checkbox15 = GUICtrlCreateCheckbox("M:", 120, 64, 33, 25)
$Checkbox16 = GUICtrlCreateCheckbox("O:", 120, 112, 33, 25)
$Checkbox17 = GUICtrlCreateCheckbox("P:", 120, 136, 33, 25)
$Checkbox18 = GUICtrlCreateCheckbox("Q:", 120, 160, 33, 25)
$Checkbox19 = GUICtrlCreateCheckbox("W:", 168, 160, 33, 25)
$Checkbox20 = GUICtrlCreateCheckbox("R:", 168, 40, 33, 25)
$Checkbox21 = GUICtrlCreateCheckbox("S:", 168, 64, 33, 25)
$Checkbox22 = GUICtrlCreateCheckbox("T:", 168, 88, 33, 25)
$Checkbox23 = GUICtrlCreateCheckbox("U:", 168, 112, 33, 25)
$Checkbox24 = GUICtrlCreateCheckbox("V:", 168, 136, 33, 25)
$Checkbox25 = GUICtrlCreateCheckbox("X:", 208, 40, 33, 25)
$Checkbox26 = GUICtrlCreateCheckbox("W:", 208, 64, 33, 25)
$Checkbox27 = GUICtrlCreateCheckbox("Z:", 208, 88, 33, 25)
$install = GUICtrlCreateButton("Install", 24, 192, 81, 25)
$Button2 = GUICtrlCreateButton("Uninstall", 112, 192, 81, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $install
            MsgBox(0,"State of Message Box ", $Checkbox1); <----------I changed this line
            ;_install()
    EndSwitch
WEnd

Func _install()
    ShellExecuteWait("DeepfreezeSetup.exe", '/install /Freeze=C,D,M,X') ; Freeze checked Disks
EndFunc

Put a check in the first check box and hit install. See the result. Then don't put a check in the box and hit install. See the result.

It is junk.Ā 

  • Developers
Posted
MsgBox(0,"State of Message Box ", $Checkbox1); <----------I changed this line
            ;_install()

Put a check in the first check box and hit install. See the result. Then don't put a check in the box and hit install. See the result.

Ā 

.. and what do you think this line you changed will show?

SciTE4AutoIt3 Full installer Download page Ā  -Ā Beta filesĀ  Ā  Ā  Ā Read before postingĀ  Ā  Ā How to post scriptsourceĀ Ā Ā Forum etiquetteĀ  Forum RulesĀ 
Ā 
Live for the present,
Dream of the future,
Learn from the past.
Ā  :)

Posted (edited)

.. and what do you think this line you changed will show?

Im thought it would show the state of the checkbox. Looking at the documentation again I'm thinking I overlooked GUICtrlRead

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 426, 236, 281, 146)
$Label1 = GUICtrlCreateLabel("Deep Freeze Silent Installation", 16, 8, 222, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Checkbox1 = GUICtrlCreateCheckbox("A:", 24, 40, 33, 25)
$Checkbox2 = GUICtrlCreateCheckbox("C:", 24, 88, 33, 25)
$Checkbox3 = GUICtrlCreateCheckbox("B:", 24, 64, 33, 25)
$Checkbox4 = GUICtrlCreateCheckbox("D:", 24, 112, 33, 25)
$Checkbox5 = GUICtrlCreateCheckbox("E:", 24, 136, 33, 25)
$Checkbox6 = GUICtrlCreateCheckbox("F:", 24, 160, 33, 25)
$Checkbox7 = GUICtrlCreateCheckbox("L:", 72, 160, 33, 25)
$Checkbox8 = GUICtrlCreateCheckbox("G:", 72, 40, 33, 25)
$Checkbox9 = GUICtrlCreateCheckbox("H:", 72, 64, 33, 25)
$Checkbox10 = GUICtrlCreateCheckbox("I:", 72, 88, 33, 25)
$Checkbox11 = GUICtrlCreateCheckbox("J:", 72, 112, 33, 25)
$Checkbox12 = GUICtrlCreateCheckbox("K:", 72, 136, 33, 25)
$Checkbox13 = GUICtrlCreateCheckbox("L:", 120, 40, 33, 25)
$Checkbox14 = GUICtrlCreateCheckbox("N:", 120, 88, 33, 25)
$Checkbox15 = GUICtrlCreateCheckbox("M:", 120, 64, 33, 25)
$Checkbox16 = GUICtrlCreateCheckbox("O:", 120, 112, 33, 25)
$Checkbox17 = GUICtrlCreateCheckbox("P:", 120, 136, 33, 25)
$Checkbox18 = GUICtrlCreateCheckbox("Q:", 120, 160, 33, 25)
$Checkbox19 = GUICtrlCreateCheckbox("W:", 168, 160, 33, 25)
$Checkbox20 = GUICtrlCreateCheckbox("R:", 168, 40, 33, 25)
$Checkbox21 = GUICtrlCreateCheckbox("S:", 168, 64, 33, 25)
$Checkbox22 = GUICtrlCreateCheckbox("T:", 168, 88, 33, 25)
$Checkbox23 = GUICtrlCreateCheckbox("U:", 168, 112, 33, 25)
$Checkbox24 = GUICtrlCreateCheckbox("V:", 168, 136, 33, 25)
$Checkbox25 = GUICtrlCreateCheckbox("X:", 208, 40, 33, 25)
$Checkbox26 = GUICtrlCreateCheckbox("W:", 208, 64, 33, 25)
$Checkbox27 = GUICtrlCreateCheckbox("Z:", 208, 88, 33, 25)
$install = GUICtrlCreateButton("Install", 24, 192, 81, 25)
$Button2 = GUICtrlCreateButton("Uninstall", 112, 192, 81, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $install
            $Temp = GUICTRLRead($Checkbox1);<------------I changed this line
            MsgBox(0,"State of Message Box ", $Temp); <----------I changed this line
            ;_install()
    EndSwitch
WEnd

Func _install()
    ShellExecuteWait("DeepfreezeSetup.exe", '/install /Freeze=C,D,M,X') ; Freeze checked Disks
EndFunc

If the box is checked guictrlread returns 1 if its unchecked it returns 4

Edited by computergroove

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Posted

Im thought it would show the state of the checkbox. Looking at the documentation again I'm thinking I overlooked GUICtrlRead

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 426, 236, 281, 146)
$Label1 = GUICtrlCreateLabel("Deep Freeze Silent Installation", 16, 8, 222, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Checkbox1 = GUICtrlCreateCheckbox("A:", 24, 40, 33, 25)
$Checkbox2 = GUICtrlCreateCheckbox("C:", 24, 88, 33, 25)
$Checkbox3 = GUICtrlCreateCheckbox("B:", 24, 64, 33, 25)
$Checkbox4 = GUICtrlCreateCheckbox("D:", 24, 112, 33, 25)
$Checkbox5 = GUICtrlCreateCheckbox("E:", 24, 136, 33, 25)
$Checkbox6 = GUICtrlCreateCheckbox("F:", 24, 160, 33, 25)
$Checkbox7 = GUICtrlCreateCheckbox("L:", 72, 160, 33, 25)
$Checkbox8 = GUICtrlCreateCheckbox("G:", 72, 40, 33, 25)
$Checkbox9 = GUICtrlCreateCheckbox("H:", 72, 64, 33, 25)
$Checkbox10 = GUICtrlCreateCheckbox("I:", 72, 88, 33, 25)
$Checkbox11 = GUICtrlCreateCheckbox("J:", 72, 112, 33, 25)
$Checkbox12 = GUICtrlCreateCheckbox("K:", 72, 136, 33, 25)
$Checkbox13 = GUICtrlCreateCheckbox("L:", 120, 40, 33, 25)
$Checkbox14 = GUICtrlCreateCheckbox("N:", 120, 88, 33, 25)
$Checkbox15 = GUICtrlCreateCheckbox("M:", 120, 64, 33, 25)
$Checkbox16 = GUICtrlCreateCheckbox("O:", 120, 112, 33, 25)
$Checkbox17 = GUICtrlCreateCheckbox("P:", 120, 136, 33, 25)
$Checkbox18 = GUICtrlCreateCheckbox("Q:", 120, 160, 33, 25)
$Checkbox19 = GUICtrlCreateCheckbox("W:", 168, 160, 33, 25)
$Checkbox20 = GUICtrlCreateCheckbox("R:", 168, 40, 33, 25)
$Checkbox21 = GUICtrlCreateCheckbox("S:", 168, 64, 33, 25)
$Checkbox22 = GUICtrlCreateCheckbox("T:", 168, 88, 33, 25)
$Checkbox23 = GUICtrlCreateCheckbox("U:", 168, 112, 33, 25)
$Checkbox24 = GUICtrlCreateCheckbox("V:", 168, 136, 33, 25)
$Checkbox25 = GUICtrlCreateCheckbox("X:", 208, 40, 33, 25)
$Checkbox26 = GUICtrlCreateCheckbox("W:", 208, 64, 33, 25)
$Checkbox27 = GUICtrlCreateCheckbox("Z:", 208, 88, 33, 25)
$install = GUICtrlCreateButton("Install", 24, 192, 81, 25)
$Button2 = GUICtrlCreateButton("Uninstall", 112, 192, 81, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $install
            $Temp = GUICTRLRead($Checkbox1);<------------I changed this line
            MsgBox(0,"State of Message Box ", $Temp); <----------I changed this line
            ;_install()
    EndSwitch
WEnd

Func _install()
    ShellExecuteWait("DeepfreezeSetup.exe", '/install /Freeze=C,D,M,X') ; Freeze checked Disks
EndFunc

If the box is checked guidtrlread returns 1 if its unchecked it returns 4

I think it is not easy . it must be more complicate

Posted

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 426, 236, 281, 146)
$Label1 = GUICtrlCreateLabel("Deep Freeze Silent Installation", 16, 8, 222, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Checkbox1 = GUICtrlCreateCheckbox("A:", 24, 40, 33, 25)
$Checkbox2 = GUICtrlCreateCheckbox("C:", 24, 88, 33, 25)
$Checkbox3 = GUICtrlCreateCheckbox("B:", 24, 64, 33, 25)
$Checkbox4 = GUICtrlCreateCheckbox("D:", 24, 112, 33, 25)
$Checkbox5 = GUICtrlCreateCheckbox("E:", 24, 136, 33, 25)
$Checkbox6 = GUICtrlCreateCheckbox("F:", 24, 160, 33, 25)
$Checkbox7 = GUICtrlCreateCheckbox("L:", 72, 160, 33, 25)
$Checkbox8 = GUICtrlCreateCheckbox("G:", 72, 40, 33, 25)
$Checkbox9 = GUICtrlCreateCheckbox("H:", 72, 64, 33, 25)
$Checkbox10 = GUICtrlCreateCheckbox("I:", 72, 88, 33, 25)
$Checkbox11 = GUICtrlCreateCheckbox("J:", 72, 112, 33, 25)
$Checkbox12 = GUICtrlCreateCheckbox("K:", 72, 136, 33, 25)
$Checkbox13 = GUICtrlCreateCheckbox("L:", 120, 40, 33, 25)
$Checkbox14 = GUICtrlCreateCheckbox("N:", 120, 88, 33, 25)
$Checkbox15 = GUICtrlCreateCheckbox("M:", 120, 64, 33, 25)
$Checkbox16 = GUICtrlCreateCheckbox("O:", 120, 112, 33, 25)
$Checkbox17 = GUICtrlCreateCheckbox("P:", 120, 136, 33, 25)
$Checkbox18 = GUICtrlCreateCheckbox("Q:", 120, 160, 33, 25)
$Checkbox19 = GUICtrlCreateCheckbox("W:", 168, 160, 33, 25)
$Checkbox20 = GUICtrlCreateCheckbox("R:", 168, 40, 33, 25)
$Checkbox21 = GUICtrlCreateCheckbox("S:", 168, 64, 33, 25)
$Checkbox22 = GUICtrlCreateCheckbox("T:", 168, 88, 33, 25)
$Checkbox23 = GUICtrlCreateCheckbox("U:", 168, 112, 33, 25)
$Checkbox24 = GUICtrlCreateCheckbox("V:", 168, 136, 33, 25)
$Checkbox25 = GUICtrlCreateCheckbox("X:", 208, 40, 33, 25)
$Checkbox26 = GUICtrlCreateCheckbox("W:", 208, 64, 33, 25)
$Checkbox27 = GUICtrlCreateCheckbox("Z:", 208, 88, 33, 25)
$install = GUICtrlCreateButton("Install", 24, 192, 81, 25)
$Button2 = GUICtrlCreateButton("Uninstall", 112, 192, 81, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $install
$ParamString = ""
$Temp1 = GUICtrlRead($Checkbox1)
$Temp1Parameter = " /a"; <-- Notice the space between the " and the /
$Temp2 = GUICtrlRead($Checkbox2)
$Temp2Parameter = " /c"

if $Temp1 == 1 then
    $ParamString = $ParamString & $Temp1Parameter
EndIf

If $Temp2 == 1 then
        $ParamString = $ParamString & $Temp2Parameter
EndIf
            MsgBox(0,"State of Message Box ", $ParamString); <----------I changed this line
            ;_install()
    EndSwitch
WEnd

Func _install()
    ShellExecuteWait("DeepfreezeSetup.exe", '/install /Freeze=C,D,M,X') ; Freeze checked Disks
EndFunc

This just sends the messagebox that shows the command line parameters. You should be able to figure it out from here. Put a check in box a and see the result. Put a check in box c and see the result. Put aĀ  check in both a and c and see the result.

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Posted (edited)

bordomavi,

Rewrote your code...see if this is what you want and, more importantly, if this makes any sense to you.

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Local $gui = GUICreate("Deep Freeze Silent Installation", 800, 150)
GUICtrlCreateLabel("Select One or More of the Following Drives:", 10, 10, 380, 20)
GUICtrlSetFont(-1, 12, 600, 0, "MS Sans Serif")

; changed checkbox control id's to be stored in an array.
; chr($1+65) returns the ascii code for each capital letter

Local $aCHKBOXIDS[26]
For $1 = 0 To UBound($aCHKBOXIDS) - 1
    $aCHKBOXIDS[$1] = GUICtrlCreateCheckbox(Chr($1 + 65), $1 * 30 + 10, 40, 30, 20)
Next

$install = GUICtrlCreateButton("Install", 10, 100, 100, 20)
$Button2 = GUICtrlCreateButton("Uninstall", 120, 100, 100, 20)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $install
            _install()
    EndSwitch
WEnd

Func _install()

    local $tDrives, $cmd

    ; iterate the array to create the Freeze parameter

    for $1 = 0 to ubound($aCHKBOXIDS) - 1
        if guictrlread($aCHKBOXIDS[$1]) = 1 then
            ConsoleWrite('checked = ' & chr($1+65) & @CRLF)
            $tDrives &= chr($1+65) & ','
        endif
    next

    $tDrives = stringtrimright($tDrives,1)
    $cmd = 'ShellExecuteWait("DeepfreezeSetup.exe", " /install /Freeze=' & $tDrives & '")'

    ConsoleWrite('Executing the following command >>> ' & $cmd & @CRLF)
EndFunc   ;==>_install

kylomas

edit: forgot closing quote

Note - I have no idea what this command is supposed to look like, you have enough here to work that out...

Edited by kylomas

Forum RulesĀ Ā Ā Ā Ā Ā Ā Ā  Procedure for posting code

"I like pigs.Ā  Dogs look up to us.Ā  Cats look down on us.Ā  Pigs treat us as equals."

- Sir Winston Churchill

Posted

bordomavi,

Rewrote your code...see if this is what you want and, more importantly, if this makes any sense to you.

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Local $gui = GUICreate("Deep Freeze Silent Installation", 800, 150)
GUICtrlCreateLabel("Select One or More of the Following Drives:", 10, 10, 380, 20)
GUICtrlSetFont(-1, 12, 600, 0, "MS Sans Serif")

; changed checkbox control id's to be stored in an array.
; chr($1+65) returns the ascii code for each capital letter

Local $aCHKBOXIDS[26]
For $1 = 0 To UBound($aCHKBOXIDS) - 1
    $aCHKBOXIDS[$1] = GUICtrlCreateCheckbox(Chr($1 + 65), $1 * 30 + 10, 40, 30, 20)
Next

$install = GUICtrlCreateButton("Install", 10, 100, 100, 20)
$Button2 = GUICtrlCreateButton("Uninstall", 120, 100, 100, 20)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $install
            _install()
    EndSwitch
WEnd

Func _install()

    local $tDrives, $cmd

    ; iterate the array to create the Freeze parameter

    for $1 = 0 to ubound($aCHKBOXIDS) - 1
        if guictrlread($aCHKBOXIDS[$1]) = 1 then
            ConsoleWrite('checked = ' & chr($1+65) & @CRLF)
            $tDrives &= chr($1+65) & ','
        endif
    next

    $tDrives = stringtrimright($tDrives,1)
    $cmd = 'ShellExecuteWait("DeepfreezeSetup.exe", " /install /Freeze=' & $tDrives & '")'

    ConsoleWrite('Executing the following command >>> ' & $cmd & @CRLF)
EndFunc   ;==>_install

kylomas

edit: forgot closing quote

Note - I have no idea what this command is supposed to look like, you have enough here to work that out...

thanks. how can i edit this gui like mine

Posted (edited)

bordomavi,

thanks. how can i edit this gui like mine

Ā 

Figure out what I did and change whatever you like.Ā  Right now the Help file is your best friend, good luck!

kylomas

edit: incidentaly, you gui had two checkboxes for drive=L

Edited by kylomas

Forum RulesĀ Ā Ā Ā Ā Ā Ā Ā  Procedure for posting code

"I like pigs.Ā  Dogs look up to us.Ā  Cats look down on us.Ā  Pigs treat us as equals."

- Sir Winston Churchill

Posted

bordomavi,

Ā 

Figure out what I did and change whatever you like.Ā  Right now the Help file is your best friend, good luck!

kylomas

edit: incidentaly, you gui had two checkboxes for drive=L

Yes i know but checkboxes are side. i wantĀ cumulatively with 4Ā column

Posted

bordomavi,

Formatting the checkboxes is a little tricky so I'll do that.Ā  The important take away from this is using an array to hold the control id's so that you can iterate the array for checked items.Ā  The alternative is adding 26 checkbox definitions and 26 "if...then" pairs to determine checkbox state.

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Local $gui = GUICreate("Deep Freeze Silent Installation", 600, 400)
local $aSize = WinGetClientSize($gui)
GUICtrlCreateLabel("Select One or More of the Following Drives:", 10, 10, 380, 20)
GUICtrlSetFont(-1, 12, 600, 0, "MS Sans Serif")

; changed checkbox control id's to be stored in an array.
; chr($1+65) returns the ascii code for each capital letter

Local $aCHKBOXIDS[26], $left = int($aSize[0]/4), $top = 30
For $1 = 0 to ubound($aCHKBOXIDS) - 1

        if mod($1,4) = 0 then
            $left = int($aSize[0]/4)
            $top += 40
        Else
            $left += 60
        endif
        $aCHKBOXIDS[$1] = GUICtrlCreateCheckbox(Chr($1 + 65), $left, $top, 50, 20)

Next

$install = GUICtrlCreateButton("Install", 10, $aSize[1] - 30, 100, 20)
$Button2 = GUICtrlCreateButton("Uninstall", 120, $aSize[1] - 30, 100, 20)

GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $install
            _install()
    EndSwitch
WEnd

Func _install()

    local $tDrives, $cmd

    ; iterate the array to create the Freeze parameter

    for $1 = 0 to ubound($aCHKBOXIDS) - 1
        if guictrlread($aCHKBOXIDS[$1]) = 1 then
            ConsoleWrite('checked = ' & chr($1+65) & @CRLF)
            $tDrives &= chr($1+65) & ','
        endif
    next

    $tDrives = stringtrimright($tDrives,1)
    $cmd = 'ShellExecuteWait("DeepfreezeSetup.exe", " /install /Freeze=' & $tDrives & '")'

    ConsoleWrite('Executing the following command >>> ' & $cmd & @CRLF)
EndFunc   ;==>_install

You can figure out any other formatting using the Help file.

kylomas

Forum RulesĀ Ā Ā Ā Ā Ā Ā Ā  Procedure for posting code

"I like pigs.Ā  Dogs look up to us.Ā  Cats look down on us.Ā  Pigs treat us as equals."

- Sir Winston Churchill

Posted

bordomavi,

Formatting the checkboxes is a little tricky so I'll do that.Ā  The important take away from this is using an array to hold the control id's so that you can iterate the array for checked items.Ā  The alternative is adding 26 checkbox definitions and 26 "if...then" pairs to determine checkbox state.

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Local $gui = GUICreate("Deep Freeze Silent Installation", 600, 400)
local $aSize = WinGetClientSize($gui)
GUICtrlCreateLabel("Select One or More of the Following Drives:", 10, 10, 380, 20)
GUICtrlSetFont(-1, 12, 600, 0, "MS Sans Serif")

; changed checkbox control id's to be stored in an array.
; chr($1+65) returns the ascii code for each capital letter

Local $aCHKBOXIDS[26], $left = int($aSize[0]/4), $top = 30
For $1 = 0 to ubound($aCHKBOXIDS) - 1

        if mod($1,4) = 0 then
            $left = int($aSize[0]/4)
            $top += 40
        Else
            $left += 60
        endif
        $aCHKBOXIDS[$1] = GUICtrlCreateCheckbox(Chr($1 + 65), $left, $top, 50, 20)

Next

$install = GUICtrlCreateButton("Install", 10, $aSize[1] - 30, 100, 20)
$Button2 = GUICtrlCreateButton("Uninstall", 120, $aSize[1] - 30, 100, 20)

GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $install
            _install()
    EndSwitch
WEnd

Func _install()

    local $tDrives, $cmd

    ; iterate the array to create the Freeze parameter

    for $1 = 0 to ubound($aCHKBOXIDS) - 1
        if guictrlread($aCHKBOXIDS[$1]) = 1 then
            ConsoleWrite('checked = ' & chr($1+65) & @CRLF)
            $tDrives &= chr($1+65) & ','
        endif
    next

    $tDrives = stringtrimright($tDrives,1)
    $cmd = 'ShellExecuteWait("DeepfreezeSetup.exe", " /install /Freeze=' & $tDrives & '")'

    ConsoleWrite('Executing the following command >>> ' & $cmd & @CRLF)
EndFunc   ;==>_install

You can figure out any other formatting using the Help file.

kylomas

i can do nextĀ 

Posted

i can do nextĀ 

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Local $gui = GUICreate("Deep Freeze Standart", 230, 400)
local $aSize = WinGetClientSize($gui)
GUICtrlCreateLabel("Deep Freeze 7.71.020.449", 10, 10, 380, 20)
GUICtrlSetFont(-1, 12, 600, 0, "MS Sans Serif")
$Input1 = GUICtrlCreateInput("KullanıcıSifresi", 11, 330, 208, 21, 0x0001)

; changed checkbox control id's to be stored in an array.
; chr($1+65) returns the ascii code for each capital letter

Local $aCHKBOXIDS[26], $left = int($aSize[0]/4), $top = 10
For $1 = 0 to ubound($aCHKBOXIDS) - 1

        if mod($1,4) = 0 then
            $left = 25
            $top += 40
        Else
            $left += 50
        endif
        $aCHKBOXIDS[$1] = GUICtrlCreateCheckbox(Chr($1 + 65), $left, $top, 30, 20)

Next

$install = GUICtrlCreateButton("KUR", 10, $aSize[1] - 37, 100, 30)
$uninstall = GUICtrlCreateButton("KALDIR", 120, $aSize[1] - 37, 100, 30)

GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $install
            _install()
    EndSwitch
WEnd

Func _install()

    local $tDrives, $cmd
    Local $sifre = GUICtrlRead($Input1)

    ; iterate the array to create the Freeze parameter

    for $1 = 0 to ubound($aCHKBOXIDS) - 1
        if guictrlread($aCHKBOXIDS[$1]) = 1 then
            ConsoleWrite('checked = ' & chr($1+65) & @CRLF)
            $tDrives &= chr($1+65) & ','
        endif
    next

    $tDrives = stringtrimright($tDrives,1)

    ShellExecuteWait("DeepfreezeSetup.exe", "/install /Freeze=' & $tDrives & '")
EndFunc   ;==>_install

it doesn't work

Posted

bordomavi,

"it does'nt work" will get you 0 help...

I don't have the pgm you are trying to run on my PC but I suspect that you need to supply the fully qualified dataset name to shellexecute...

Forum RulesĀ Ā Ā Ā Ā Ā Ā Ā  Procedure for posting code

"I like pigs.Ā  Dogs look up to us.Ā  Cats look down on us.Ā  Pigs treat us as equals."

- Sir Winston Churchill

Posted

bordomavi,

"it does'nt work" will get you 0 help...

I don't have the pgm you are trying to run on my PC but I suspect that you need to supply the fully qualified dataset name to shellexecute...

how can i write thisĀ ShellExecuteWait("DeepfreezeSetup.exe", "/install /Freeze=' & $tDrives & '")

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...