ainner Posted November 9, 2007 Share Posted November 9, 2007 (edited) Is it possible to detect that an AutoIt exe file is already running without knowing it's name. For example : I wanna run Fruit.exe but I don't want it to start if there's another autoit already running. It would be easy to do an "If ProcessExists" but I have no idea what can be running since they are many autoit process that are trigger depending on the user. Thx Edited November 9, 2007 by ainner Link to comment Share on other sites More sharing options...
DW1 Posted November 9, 2007 Share Posted November 9, 2007 you cannot make an array of all the autoit scripts to check against? AutoIt3 Online Help Link to comment Share on other sites More sharing options...
schilbiz Posted November 9, 2007 Share Posted November 9, 2007 (edited) Q3. How can I prevent more than one copy of my script from running at once / detect another copy of my script running? A1. You can use a function called _Singleton to detect multiple instances of your script. An example of how to use this code: CODE: AutoIt #include <Misc.au3> _Singleton("TheNameOfMyScript") In this instance, the script will immediately exit if there is already one copy running. If you simply want know if another copy is running, you can use code similar to the next example: CODE: AutoIt#include <Misc.au3> If _Singleton("MyScriptName", 1) Then ; We know the script is already running. Let the user know. MsgBox(0, "Script Name", "This script is already running. Using multiple copies of this script at the same breaks the [(UltimaCoder)] License!") Exit Endif This is from the FAQs Edited November 9, 2007 by schilbiz Link to comment Share on other sites More sharing options...
Emiel Wieldraaijer Posted November 9, 2007 Share Posted November 9, 2007 ?????????????? basicly you are saying I run one program which is made in AutoIt and i will not allow another program which is written in AutoIt ! if this is correct .. good luck .. otherwise .. if you want to check if your program is run and you do not want people to rename the exe - First do a check for the existense of a ini file which is created later - Let the program create an inifile in the temp folder when it's started - Use adlib enable function to check if the ini file isn't deleted otherwise recreate it Best regards,Emiel Wieldraaijer Link to comment Share on other sites More sharing options...
schilbiz Posted November 9, 2007 Share Posted November 9, 2007 (edited) I see what you are asking, you want to be able to tell if some other Autoit script is running but you don't know which? The FAQ suggestion seems to only work if you are trying to run it but know which .exe you are running. That may be tough to do. Edited November 9, 2007 by schilbiz Link to comment Share on other sites More sharing options...
ainner Posted November 9, 2007 Author Share Posted November 9, 2007 (edited) Yeah, I got a form running in the Run key and the user gotta click on "Accept" for it to close then I delete the run entry in the registry. The thing is I don't want another autoit to start installing an application on top of my form when the user open a session. Since we're making new scripts every week I can't block them all unless there's a way to know if there's already another autoit that is curently running. Edited November 9, 2007 by ainner Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 9, 2007 Moderators Share Posted November 9, 2007 Yeah, I got a form running in the Run key and the user gotta click on "Accept" for it to close then I delete the run entry in the registry. The thing is I don't another autoit to start installing an application on top of my form when the user open a session.Since we're making new scripts every week I can't block them all unless there's a way to know if there's already another autoit that is curently running.Just use _Singleton() in your scripts from now on... Unless you want to hunt through every old exe you've sent out and check it's checksum and delete it when found. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
rover Posted November 9, 2007 Share Posted November 9, 2007 (edited) easy all AutoIt programs have a hidden window titled AutoIt v3 use winlist and parse results Edited November 9, 2007 by rover I see fascists... Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 9, 2007 Moderators Share Posted November 9, 2007 easyall AutoIt programs have a hidden window titled AutoIt v3use winlist and parse resultsThat would prevent "any" autoit script from running, I was under the impression he/she was only wanting to stop a specific one they made... Is this incorrect? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
ainner Posted November 9, 2007 Author Share Posted November 9, 2007 easyall AutoIt programs have a hidden window titled AutoIt v3use winlist and parse resultsI'll try that and I'll give you feedback thx Link to comment Share on other sites More sharing options...
ainner Posted November 9, 2007 Author Share Posted November 9, 2007 That would prevent "any" autoit script from running ...That's what I want. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now