Jump to content
Sign in to follow this  
gcue

help with conditional logic

Recommended Posts

gcue

ok i have a script that checks if an app is in startup (registry startup), the script can enable/disable from regsitry startup also

checked=enabled for startup

unchecked=disabled from startup

so heres what happens when i run the check_startup function- when i run the check_startup function (shown below), anything that was set for startup gets unchecked.

hope this makes sense (please let me know if you need more info/clarification).

For $i = 1 To 100
$strings = RegEnumVal("hkey_local_machine\software\microsoft\windows\currentversion\run", $i)
$app = RegRead("hkey_local_machine\software\microsoft\windows\currentversion\run", $strings)

    If $app = "c:\lotus\notes\notes.exe" Then
        GUICtrlSetState($check_Notes, $GUI_CHECKED)
    Else
        GUICtrlSetState($check_Notes, $GUI_UNCHECKED)
    EndIf
Edited by gcue

Share this post


Link to post
Share on other sites
Jos

Sounds logical to me.

If one of the RUN registry entries is Notes.exe then that would main that all others are NOT. Meaning it gets UNCHECKED.

Logic to me would be to uncheck all at creation time and only change them to Checked when the actual program is found.

Jos


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

Share this post


Link to post
Share on other sites
gcue

yea thats how i had it Jos. but i guess itd be nice to allow the user to check at anytime to verify settings

Share this post


Link to post
Share on other sites
Jos

yea thats how i had it Jos. but i guess itd be nice to allow the user to check at anytime to verify settings

I do not understand the point your are making here. The registry only contains those programs that are "enabled" thus the default is disabled.

Jos


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

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  

×