Sign in to follow this  
Followers 0
gcue

help with conditional logic

4 posts in this topic

#1 ·  Posted (edited)

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



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


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                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

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

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


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                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  
Followers 0