Sign in to follow this  
Followers 0
gcue

help with multiple loops

5 posts in this topic

#1 ·  Posted (edited)

hello.

i am trying to find out if a pc has a shortcut to nlnotes.exe or notes.exe in their windows profile startup folder

the $lnk_file = FileFindNextFile($shortcut_search) produces some blank results at the tail end of its search so when it tries to FileGetShortcut on that file, it gets stuck

i tried

if $lnk_file = "" Then

ContinueLoop 2

EndIf

and

If @error Then ContinueLoop 2

but i dont get accurate results - should be loop2 right? bc loop1 is the For Loop

any ideas?

For $x = 1 To UBound($profiles) - 1

    $shortcut_search = FileFindFirstFile("\\" & $asset & "\c$\documents and settings\" & $profiles[$x] & "\start menu\programs\startup\*.lnk")

    If $shortcut_search = -1 Then
        ContinueLoop
    EndIf

    While 1
        $lnk_file = FileFindNextFile($shortcut_search)

        ;MsgBox(0, "", $file)

;~          If @error Then ExitLoop 2

        If $lnk_file = "" Then
            ContinueLoop 2
        EndIf

        $shortcut_path = FileGetShortcut("\\" & $asset & "\c$\documents and settings\" & $profiles[$x] & "\start menu\programs\startup\" & $lnk_file)

        If $shortcut_path = "c:\lotus\notes\notes.exe" Then
            MsgBox(0, "standard", "profile startup")
            $user = $profiles[$x]
            $startup_location = "..\<Profile>\..\Startup"
            $exe = "notes.exe"
        EndIf

        If $shortcut_path = "c:\lotus\notes\nlnotes.exe" Then
            MsgBox(0, "basic", "profile startup")
            $user = $profiles[$x]
            $startup_location = "..\<Profile>\..\Startup"
            $exe = "nlnotes.exe"
        EndIf
    WEnd
Next
Edited by gcue

Share this post


Link to post
Share on other sites



seems to exit prematurely still

Share this post


Link to post
Share on other sites

...should be loop2 right? bc loop1 is the For Loop

No. Loop 1 is the most immediate (innermost) loop. Loop 2 is the parent (outer loop) that contains loop 1.
For $A = 1 To 5
    ConsoleWrite("Outer loop: " & $A & @LF)
    For $B = 1 To 5
        ConsoleWrite(@TAB & "Inner loop: " & $B & @LF)
        If $B = 4 Then ExitLoop 1
    Next
Next

;)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

i figured it out..

i forgot the [0] in the filegetshortcut - doh!!!!

my apologies

thanks for your help!

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