Jump to content

Recommended Posts

Posted

I want the script to check if there are any other copies of it running at the moment.

; Load all windows into a variable
    $winlist = WinList()
; Check each window to see if it is an instance of MyScript
    $count = 0
    For $a = 1 to $winlist[0][0]
        If StringLeft($winlist[$a][0], 8) = "MyScript" Then 
            $count = $count + 1
        EndIf
    Next
All well and good, but the code detects both the window "MyScript.exe" and the folder where it lives, "MyScript", when the folder is open. This is potentially bad.

What's the procedure for checking if a window is a folder, or not?

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...