goodbyeplanet 0 Posted November 18, 2010 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"') EndIfHow can i go about achieving that. thanks for your help and for your clues. Share this post Link to post Share on other sites
ShawnW 0 Posted November 18, 2010 Try something like this While True ProcessWait("notepad.exe") If Not ProcessExists("phpeditor.exe") Then RunWait("C:\phpeditor.exe") ProcessWaitClose("notepad.exe") ProcessClose("phpeditor.exe") WEnd 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