Sign in to follow this  
Followers 0
Skizz

Looping

4 posts in this topic

I can not figure this out to save my life! I need to return to the original GUI, but it keeps exiting once the programs have executed. Any ideas?

;This creates the inital GUI box

;To Remove any non-needed checkboxes simply remark any of the CHKBOX lines

GUICreate ("Trading Floor Support Fix List",580,400)

GUISetFont(14,600)

GUICtrlCreateLabel("What would you like to fix?",125,80)

GUISetFont(9,400)

GUICtrlCreateLabel("Created by Bryan",125,110)

GUISetFont(8,200)

$APP1_CHKBOX = GUICtrlCreateCheckbox("Internet Explorer New Window Fix",10,150) ;Checkbox 1

$APP2_CHKBOX = GUICtrlCreateCheckbox("IE Options",10,170) ;Checkbox 2

$APP3_CHKBOX = GUICtrlCreateCheckbox("Terminal Services",10,190) ;Checkbox 3

$APP4_CHKBOX = GUICtrlCreateCheckbox("WSFTP Editor INI",10,210) ;Checkbox 4

$APP5_CHKBOX = GUICtrlCreateCheckbox("WSFTP Publisher INI",10,230) ;Checkbox 5

$APP6_CHKBOX = GUICtrlCreateCheckbox("WSFTP Wallstreet Webcast INI",10,250) ;Checkbox 6

;$APP7_CHKBOX = GUICtrlCreateCheckbox("This is Application 7 select to run",10,250) ;Checkbox 7

;$APP8_CHKBOX = GUICtrlCreateCheckbox("This is Application 8 select to run",10,270) ;Checkbox 8

;$APP9_CHKBOX = GUICtrlCreateCheckbox("This is Application 9 select to run",10,290) ;Checkbox 9

;$APP10_CHKBOX = GUICtrlCreateCheckbox("This is Application 10 select to run",10,310) ;Checkbox 10

$RUN = GUICtrlCreateButton("Install",10,350,120,20) ;This in the Run button

$EXIT = GUICtrlCreateButton("Exit",450,350,120,20) ;This causes the application to exit

GUISetState()

Do

$msg = GUIGetMsg()

;Reads the status of the Checkboxes and sets a variable to either 1 for checked or 4 for not checked

;This HAS to be included before the UNTIL statement

$status1 = GUICtrlRead($APP1_CHKBOX)

$status2 = GUICtrlRead($APP2_CHKBOX)

$status3 = GUICtrlRead($APP3_CHKBOX)

$status4 = GUICtrlRead($APP4_CHKBOX)

$status5 = GUICtrlRead($APP5_CHKBOX)

$status6 = GUICtrlRead($APP6_CHKBOX)

;$status7 = GUICtrlRead($APP7_CHKBOX)

;$status8 = GUICtrlRead($APP8_CHKBOX)

;$status9 = GUICtrlRead($APP9_CHKBOX)

;$status10 = GUICtrlRead($APP10_CHKBOX)

Until $msg = $RUN

;Checks the status of the Checkboxes and calls the application function(s) if the checkbox is enabled

IF $status1 = 1 then call ("IE_NEWWIN_FIX")

IF $status2 = 1 then call ("IEOPTIONS")

IF $status3 = 1 then call ("TerminalServices")

IF $status4 = 1 then call ("WSFTPEditor")

IF $status5 = 1 then call ("WSFTP Publisher INI")

IF $status6 = 1 then call ("WSFTP Wallstreet Webcast")

IF $status7 = 1 then call ("APP_7")

IF $status8 = 1 then call ("APP_8")

IF $status9 = 1 then call ("APP_9")

IF $status10 = 1 then call ("APP_10")

If $msg = $EXIT then exit

;Add Application Functions here

Func IE_NEWWIN_FIX() ;IE New Windows Issue Fix

run("regsvr32 /s oleaut32.dll")

run("regsvr32 /s oleaut32.dll")

run("regsvr32 /s shdocvw.dll")

run("regsvr32 /s actxproxy.dll")

run("regsvr32 /s mshtml.dll")

run("regsvr32 /s pdm32.dll")

EndFunc

Func IEOPTIONS();Function for IE Options

DIM $Computer

$Computer = Inputbox("Type remote computername", "Computername", "")

RegWrite("\\" & $Computer & "\HKEY_LOCAL_MACHINE\SOFTWARE","TestKey","REG_SZ","Hello this is a test")

EndFunc

;Func IEOPTIONS();Function for IE Options

RegWrite ("HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Control Panel","Connwiz Admin Lock","REG_DWORD","00")

RegWrite ("HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Control Panel","Advanced","REG_DWORD","00")

RegWrite ("HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Control Panel","Autoconfig","REG_DWORD","00")

RegWrite ("HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Control Panel","Check_If_Default","REG_DWORD","00")

RegWrite ("HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Control Panel","Homepage","REG_DWORD","00")

RegWrite ("HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Control Panel","links","REG_DWORD","00")

RegWrite ("HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Control Panel","Proxy","REG_DWORD","00")

RegWrite ("HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Control Panel","ResetWebSettings","REG_DWORD","00")

;EndFunc

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

[ code] [ /code] tags without spaces in them are awesome :)

Edit:

Maybe use 2 loops?

GUICreate("Trading Floor Support Fix List",580,400)
GUISetFont(14,600)
GUICtrlCreateLabel("What would you like to fix?",125,80)
GUISetFont(9,400)
GUICtrlCreateLabel("Created by Bryan",125,110)
GUISetFont(8,200)
$APP1_CHKBOX = GUICtrlCreateCheckbox("Internet Explorer New Window Fix",10,150);Checkbox 1
$APP2_CHKBOX = GUICtrlCreateCheckbox("IE Options",10,170);Checkbox 2
$APP3_CHKBOX = GUICtrlCreateCheckbox("Terminal Services",10,190);Checkbox 3
$APP4_CHKBOX = GUICtrlCreateCheckbox("WSFTP Editor INI",10,210);Checkbox 4
$APP5_CHKBOX = GUICtrlCreateCheckbox("WSFTP Publisher INI",10,230);Checkbox 5
$APP6_CHKBOX = GUICtrlCreateCheckbox("WSFTP Wallstreet Webcast INI",10,250);Checkbox 6
;$APP7_CHKBOX = GUICtrlCreateCheckbox("This is Application 7 select to run",10,250);Checkbox 7
;$APP8_CHKBOX = GUICtrlCreateCheckbox("This is Application 8 select to run",10,270);Checkbox 8
;$APP9_CHKBOX = GUICtrlCreateCheckbox("This is Application 9 select to run",10,290);Checkbox 9
;$APP10_CHKBOX = GUICtrlCreateCheckbox("This is Application 10 select to run",10,310);Checkbox 10
$RUN = GUICtrlCreateButton("Install",10,350,120,20);This in the Run button
$EXIT = GUICtrlCreateButton("Exit",450,350,120,20);This causes the application to exit
GUISetState()

While 1
Do
    $msg = GUIGetMsg()
    Do
        $msg2 = GUIGetMsg()
        Sleep(10)
    Until $msg2 = $RUN
;Checks the status of the Checkboxes and calls the application function(s) if the checkbox is enabled
    If GUICtrlRead($APP1_CHKBOX) = 1 Then Call("IE_NEWWIN_FIX")
    If GUICtrlRead($APP2_CHKBOX) = 1 Then Call("IEOPTIONS")
    If GUICtrlRead($APP3_CHKBOX) = 1 Then Call("TerminalServices")
    If GUICtrlRead($APP4_CHKBOX) = 1 Then Call("WSFTPEditor")
    If GUICtrlRead($APP5_CHKBOX) = 1 Then Call("WSFTP Publisher INI")
    If GUICtrlRead($APP6_CHKBOX) = 1 Then Call("WSFTP Wallstreet Webcast")
;If GUICtrlRead($APP7_CHKBOX) = 1 Then Call("APP_7")
;If GUICtrlRead($APP8_CHKBOX) = 1 Then Call("APP_8")
;If GUICtrlRead($APP9_CHKBOX) = 1 Then Call("APP_9")
;If GUICtrlRead($APP10_CHKBOX) = 1 Then Call("APP_10")
    If $msg = $EXIT Then Exit
;Add Application Functions here
    Sleep(10)
WEnd
Func IE_NEWWIN_FIX();IE New Windows Issue Fix
    Run("regsvr32 /s oleaut32.dll")
    Run("regsvr32 /s oleaut32.dll")
    Run("regsvr32 /s shdocvw.dll")
    Run("regsvr32 /s actxproxy.dll")
    Run("regsvr32 /s mshtml.dll")
    Run("regsvr32 /s pdm32.dll")
EndFunc ;==>IE_NEWWIN_FIX
Func IEOPTIONS();Function for IE Options
    Dim $Computer
    $Computer = InputBox("Type remote computername", "Computername", "")
    RegWrite("\\" & $Computer & "\HKEY_LOCAL_MACHINE\SOFTWARE","TestKey","REG_SZ","Hello this is a test")
EndFunc ;==>IEOPTIONS
;Func IEOPTIONS();Function for IE Options
RegWrite("HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Control Panel","Connwiz Admin Lock","REG_DWORD","00")
RegWrite("HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Control Panel","Advanced","REG_DWORD","00")
RegWrite("HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Control Panel","Autoconfig","REG_DWORD","00")
RegWrite("HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Control Panel","Check_If_Default","REG_DWORD","00")
RegWrite("HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Control Panel","Homepage","REG_DWORD","00")
RegWrite("HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Control Panel","links","REG_DWORD","00")
RegWrite("HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Control Panel","Proxy","REG_DWORD","00")
RegWrite("HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Control Panel","ResetWebSettings","REG_DWORD","00")
;EndFunc

Edit2:

Call("WSFTP Publisher INI")

Call("WSFTP Wallstreet Webcast")

Don't look right (spaces in a function name), and to call a function all you really need to do is like:

If GUICtrlRead($APP1_CHKBOX) = 1 Then IE_NEWWIN_FIX()
Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

I keep getting an error: "wend" statement with no matching while statement with the code mentioned previously?

Share this post


Link to post
Share on other sites

I have attached a screeshot of what it looks like once the program executes, then once the user would click "install" after they have checked a checkbox, it runs, then shuts down the app, I am trying to get it to return to the main list once the programs have been executed.

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