Jump to content
Sign in to follow this  

automatically start second exe when first exe fires

Recommended Posts


Hello autoit community. I have an exe that I need to open automatically when the first exe file is opened. For example if i open notepad.exe it should open phpeditor.exe automatically. I have managed to do this but it only works manually if i first open notepad and then run the script manually. What i want is for phpeditor.exe to fire up immediately when i open notepad.exe:

If ProcessExists("notepad.exe") Then
    runwait( '"C:\phpeditor.exe"')      

How can i go about achieving that. thanks for your help and for your clues.

Share this post

Link to post
Share on other sites

Try something like this

While True
    If Not ProcessExists("phpeditor.exe") Then RunWait("C:\phpeditor.exe")

You basically keep this running all the time. When the 1st instance of notepad is opened, it will open phpeditor if it is not already running. Nothing will happen if you open more notpads. Once all notepads are closed it will close phpeditor (if that is not needed just take that line out). If all notepads are closed and another is opened then phpeditor will start again if it is not already running.

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.