Sign in to follow this  
Followers 0
Psychotron

Run a program only if is not already running

3 posts in this topic

Hi all,

Is there a way to launch a program only if it is not already running?

Any help appreciated

Thanks in advance

Share this post


Link to post
Share on other sites



Check out _Singleton() in the helpfile.

Share this post


Link to post
Share on other sites

Psychotron,

Check out ProcessExists in the help file.  _Singleton() would be used if you just want one instance of your script running and ProcessExists would check if any processes are running (i.e. chrome.exe, notepad.exe, iexplore.exe).

If ProcessExists("notepad.exe") Then
    MsgBox(16, "Error", "Only one notepad.exe process can run at a time.")
Else
    ; run your code here
    Run("notepad.exe")
EndIf

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