YoannMorl Posted November 16, 2012 Share Posted November 16, 2012 Hi, I'm working on a simple script to centrlize some tools we are using at work. I compile it on my computer and it runs normally. On some others computers, no problem. But on some, the script is running and launch itsefl infinitelly. Don't know why. I've added that at the start of the script, but nothing better : $list = ProcessList('cstools.exe') If $list [0][0] > 1 Then ProcessClose('cstools.exe') EndIf I've taken an old working version of my script, then compiled it, and the same problem happen. i don't understand. Could you help me please, i don't know what to do. Regards. Link to comment Share on other sites More sharing options...
water Posted November 16, 2012 Share Posted November 16, 2012 If you want to make sure that only one instance of your script is running use function _Singleton. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
YoannMorl Posted November 16, 2012 Author Share Posted November 16, 2012 Hi, Thanks for your quick reply. I've added this part of code in my script : #include <Misc.au3> If _Singleton("CS Tools", 1) = 0 Then MsgBox(0, "Erreur", "CS Tools est dêja en cours d'éxécution !") Exit EndIf The script works on my computer. But on others computers, thje probleme is the same like on my first post. I launch the compiled exe, and in the task manager, my script appears and appears etc... Link to comment Share on other sites More sharing options...
FireFox Posted November 16, 2012 Share Posted November 16, 2012 Hi, Can you post the whole script? Check if there is a shellexecute or something like this. Br, FireFox. Link to comment Share on other sites More sharing options...
water Posted November 16, 2012 Share Posted November 16, 2012 I once had a similar problem. A script needed local admin rights. I have local admin rights on my computer hence the script was running fine. When started on a thin client (where the script is executed on the terminal server) I had the same results. The script was started over and over again. I now query the computer name and exit if the script is not being run on my PC. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
YoannMorl Posted November 16, 2012 Author Share Posted November 16, 2012 The script has more than 2500 lines and some private infos. The problem is that when i compile an older working version of the script, the same problem appear. Don't understand why. If i had the time, i'll modify the script to hide private infos and i'll post it here. If you have any idea, i'll take it ^^ Regards. Link to comment Share on other sites More sharing options...
water Posted November 16, 2012 Share Posted November 16, 2012 Do you have any script in your codethat starts a script like Run, RunWait, ShellExecute or ShellExecuteWait?#RequireAdmin directives? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
YoannMorl Posted November 16, 2012 Author Share Posted November 16, 2012 Hey, Thanks water for your response, i've removed a #RequireAdmin line and it's doing the trick ^^ Thanks for all. Link to comment Share on other sites More sharing options...
water Posted November 16, 2012 Share Posted November 16, 2012 If you check the help file for "#RequireAdmin" you will see that "this function launches a new process". But it's not clear to me why it does this in a loop. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
YoannMorl Posted November 16, 2012 Author Share Posted November 16, 2012 Same non understand for me. The function was in the middle of my script. Thanks again ^^ Link to comment Share on other sites More sharing options...
water Posted November 16, 2012 Share Posted November 16, 2012 #RequireAdmin is a directive which is honored before any other processing is being done. So it doesn't matter where in the script it can be found. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki 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