rcmaehl Posted December 15, 2021 Share Posted December 15, 2021 (edited) Hi all, I'm pretty sure this is once again me being absolutely dumb and missing something obvious. I need to ProcessClose() other instances of a script. I'm attempting to do so by comparing @AutoItPID to ProcessList() but the application kills itself. My current code is as follows and I've tried on both stable and latest beta. #include <Array.au3> If Not @Compiled Then MsgBox(0, "", "Compile before testing...") Exit EndIf $aPIDs = ProcessList(@ScriptName) _ArrayDisplay($aPIDs, @AutoItPID) For $iLoop = 1 To $aPIDs Step 1 If $aPIDs[$iLoop] = @AutoItPID Then ;;; ElseIf Number($aPIDs[$iLoop]) = @AutoItPID Then ;;; ElseIf $aPIDs[$iLoop] = Number(@AutoItPID) Then ;;; ElseIf Number($aPIDs[$iLoop]) = Number(@AutoItPID) Then ;;; Else MsgBox(0, "Closing", $aPIDs[$iLoop]) ProcessClose($aPIDs[$iLoop]) EndIf MsgBox(0, "", $iLoop) Next $aPIDs = ProcessList(@ScriptName) _ArrayDisplay($aPIDs) MsgBox(0, "", "We will never get here") Exit Can anyone point me in the right direction? I should invest in a rubber duck. Found the issue. Edited December 15, 2021 by rcmaehl My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.My Projects WhyNotWin11Cisco Finesse, Github, IRC UDF, WindowEx UDF Link to comment Share on other sites More sharing options...
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
Already have an account? Sign in here.Sign In Now