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[0][0] Step 1 If $aPIDs[$iLoop][0] = @AutoItPID Then ;;; ElseIf Number($aPIDs[$iLoop][0]) = @AutoItPID Then ;;; ElseIf $aPIDs[$iLoop][0] = Number(@AutoItPID) Then ;;; ElseIf Number($aPIDs[$iLoop][0]) = Number(@AutoItPID) Then ;;; Else MsgBox(0, "Closing", $aPIDs[$iLoop][0]) ProcessClose($aPIDs[$iLoop][0]) 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...
bobomb Posted December 15, 2021 Share Posted December 15, 2021 Isnt it this? If $aPIDs[$iLoop][1] = @AutoItPID Then for process #? rcmaehl 1 Link to comment Share on other sites More sharing options...
rcmaehl Posted December 15, 2021 Author Share Posted December 15, 2021 (edited) Just now, bobomb said: Isnt it this? If $aPIDs[$iLoop][1] = @AutoItPID Then for process #? YEPPPPPPPPP. 🤦♂️ 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...
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