Sign in to follow this  
Followers 0
roadrunner

Check To See If Scripe Is Already Running

4 posts in this topic

Hi agian, another simple question for you.

how can I check to see if a scripe is already running and if so, stop another scripe from loading up running.

simple a, but i'm have trouble with it.

any help. :whistle:

Share this post


Link to post
Share on other sites



See AutoItSetTitle and AutoItGetTitle in the help file... Hmm, this could be improved...

Add this to the beginning of a script to prevent it from running a second instance:

If AutoItWinGetTitle() = "Some unique program title goes here" Then Exit
AutoItSetTitle("Some unique program title goes here")

Hope that helps


Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

I think what roadrunner was asking, is if there is any way for a script to determine if another instance is already running in memory...

I've played around with ProcessExists(), AutoItWinGetTitle(), as well as other functions; but haven't had any luck checking if the compiled script is already running. I've also looked into using task manager (taskmgr.exe) to parse the list of open processes, but haven't had any luck with getting a usable screen-scrape.

Hopefully somebody knows of an easier way to obtain a list of processes currently in memory... :whistle:

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

$g_szVersion = "My Script 1.1"
If WinExists($g_szVersion) Then Exit  ; It's already running
AutoItWinSetTitle($g_szVersion)

That names your script. The next time its run, if it finds that name, it will exit, otherwise, it must be the first instance, so it names itself.

Edited by Valik

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