Jump to content

Allow only once instance of a script


sandyd
 Share

Recommended Posts

Hi All,

is there any easy way to allow only once instance of my script at any one time.

I know I can do this with a gui app by setting the title, but is there any way for a non-gui script.

<{POST_SNAPBACK}>

It's in the help file, question 14 of the FAQ:

CODE

14. How can I make sure only one copy of my script is run?

The easiest way is to rename the title of the hidden AutoIt window when your script first starts.

Then in the same script check for that window title existing - if it does then another

copy of the script is running.

; Place at the top of your script

$g_szVersion = "My Script 1.1"

If WinExists($g_szVersion) Then Exit ; It's already running

AutoItWinSetTitle($g_szVersion)

; Rest of your script goes here

Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Link to comment
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
 Share

  • Recently Browsing   0 members

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