gcue Posted December 9, 2009 Posted December 9, 2009 (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 December 9, 2009 by gcue
whim Posted December 9, 2009 Posted December 9, 2009 Why not just use If $link_file = "" Then Exitloop instead of If $link_file = "" Then ContinueLoop 2 EndIf whim
PsaltyDS Posted December 10, 2009 Posted December 10, 2009 ...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
gcue Posted December 10, 2009 Author Posted December 10, 2009 i figured it out.. i forgot the [0] in the filegetshortcut - doh!!!! my apologies thanks for your help!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now