Jump to content

Run a program only if is not already running


Recommended Posts

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
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...