Jump to content
Sign in to follow this  

if i run this little piece of code my program closes/crashes

Recommended Posts



i am very new to this forum and to autoit, i have been struggeling for about to weeks now.

if i run my program and i check the one checkbox there is, then it wil run the setup but when the setup is finished my program closes/crashes, how come?

i think my program crashes because the network share i create when the button install is clicked does not disconnect after the setup.

This is the code i have:

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=H:\AutoIT\Game Installer1.kxf

$Form2 = GUICreate("Game Installer BETA", 661, 571, -1, -1)

$Close = GUICtrlCreateButton("Close", 568, 528, 75, 25, 0)

$Install = GUICtrlCreateButton("Install", 480, 528, 75, 25, 0)

$COD2 = GUICtrlCreateCheckbox("Call of Duty 2", 104, 128, 145, 25)

GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")


#EndRegion ### END Koda GUI section ###

While 1

$msg = GUIGetMsg()

Switch $msg

Case $Install







Func uitvoeren()

DriveMapAdd("Z:" , "\\\Share" , 0 , "Mark" , "getin")


If $COD2 = $GUI_CHECKED Then RunWait ("Z:\COD2\setup.exe") EndIf

; RunWait ("Z:\COD2\setup.exe")


Share this post

Link to post
Share on other sites

Several things appear to be wrong:

1) Space between RunWait and the "("

2) Don't need the EndIf on a one line If statement

3) I don't think the variable $COD2 will ever equal $GUI_CHECKED. I think you want to check GUICtrlRead($COD2)=$GUI_CHECKED

Hope this helps,


You can't see a rainbow without first experiencing the rain.

Share this post

Link to post
Share on other sites

oh thank you so much, now it works :D

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.