jero1987 Posted April 24, 2007 Share Posted April 24, 2007 Hey Can anyone help me out with some syntax? I need a function that when my .exe starts it checks to see if one process already exists and if one does it just stop execution of the script? and I also need the same function but will continually check for another instance of the process to kill. The problem is that i have my compiled script running on Startup for our users but if they double click on the program it starts another instance. Thanks a million guys.... and thanks alot to AutoIt for making my IT job so much easier! James Link to comment Share on other sites More sharing options...
Generator Posted April 24, 2007 Share Posted April 24, 2007 Hey Can anyone help me out with some syntax? I need a function that when my .exe starts it checks to see if one process already exists and if one does it just stop execution of the script? and I also need the same function but will continually check for another instance of the process to kill. The problem is that i have my compiled script running on Startup for our users but if they double click on the program it starts another instance. Thanks a million guys.... and thanks alot to AutoIt for making my IT job so much easier! JamesFor checking process Global $Process="Your name" While 1 If $Check=ProcessExists($Process)=0 Then Exit EndIf Sleep(1000) WEnd oÝ÷ ØZ+*)ex®²Æ®¶s` ¤vÆö&Âb33cµ&ö6W73ÒgV÷Cµ÷W"æÖRgV÷C°¥vÆR¤bb33c´6V6³Õ&ö6W74W7G2b33cµ&ö6W72ÓFVà¥&ö6W74¶ÆÂb33cµ&ö6W72¤VæD`¥6ÆVW¥tVæ@ For no running twice: Check _Singleton What's the use of your program? Link to comment Share on other sites More sharing options...
jero1987 Posted April 24, 2007 Author Share Posted April 24, 2007 Thank you Very Much for your quick response! The program takes a network authentication program, saves user credentials, and does task such as auto log on, and a whole host of other things. Thank you very much! Link to comment Share on other sites More sharing options...
jero1987 Posted April 24, 2007 Author Share Posted April 24, 2007 Well i tried and it didn't work, maybe I am not implementing it correctly. Lets say i have AuthAgent.exe for example, it runs on startup and it runs in the background. I want it so that if a user clicks AuthAgent.exe again, there will not be multiple instances of AuthAgent.exe running. I want to keep the original instance there. Any help? Link to comment Share on other sites More sharing options...
Generator Posted April 24, 2007 Share Posted April 24, 2007 Well i tried and it didn't work, maybe I am not implementing it correctly. Lets say i have AuthAgent.exe for example, it runs on startup and it runs in the background. I want it so that if a user clicks AuthAgent.exe again, there will not be multiple instances of AuthAgent.exe running. I want to keep the original instance there. Any help?Global $AuthAgent="AuthAgent" If WinExists($AuthAgent)=1 Then Exit EndIf AutoItWinSetTitle($AuthAgent) Put that at Beginning of your script. Link to comment Share on other sites More sharing options...
jero1987 Posted April 24, 2007 Author Share Posted April 24, 2007 Global $AuthAgent="AuthAgent" If WinExists($AuthAgent)=1 Then Exit EndIf AutoItWinSetTitle($AuthAgent) Put that at Beginning of your script. thank you ill give that a shot Link to comment Share on other sites More sharing options...
jero1987 Posted April 24, 2007 Author Share Posted April 24, 2007 Global $AuthAgent="AuthAgent" If WinExists($AuthAgent)=1 Then Exit EndIf AutoItWinSetTitle($AuthAgent) Put that at Beginning of your script. works like a dream thanks man! i owe u one! 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