Sign in to follow this  
Followers 0
YoannMorl

Help, my script runs in a loop...

11 posts in this topic

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.

Share this post


Link to post
Share on other sites



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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

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...

Share this post


Link to post
Share on other sites

Hi,

Can you post the whole script? Check if there is a shellexecute or something like this.

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Do you have any script in your code

  • that starts a script like Run, RunWait, ShellExecute or ShellExecuteWait?
  • #RequireAdmin directives?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Hey,

Thanks water for your response, i've removed a #RequireAdmin line and it's doing the trick ^^

Thanks for all.

Share this post


Link to post
Share on other sites

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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Same non understand for me. The function was in the middle of my script.

Thanks again ^^

Share this post


Link to post
Share on other sites

#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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

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  
Followers 0