m00

Script acts differently when compiled - exits While loop

3 posts in this topic

So I have a very simple script that works fine when I run it with "Go" from the Tools menu of SciTE, but does not when I compile and run it as an executable.

 

While 1
    If FileExists("C:\Folder\File.exe") Then
        FileDelete("C:\Folder\File_m00.exe")
        FileMove("C:\Folder\File.exe","C:\Folder\File_m00.exe",1)
        Run("C:\Folder\File_m00.exe")
    EndIf
sleep(8000)
WEnd

When run as a "Go" it does what you would expect, and runs the File_m00.exe, and then continues to loop, looking for a new File.exe to appear.

 

When I compile, it loops dutifully until it encounters the File.exe, does the rename(move) and then runs the File_m00.exe. However, the program then exits. Is there something I am missing with the Run command in a compiled script that differs from running it uncompiled?

Share this post


Link to post
Share on other sites

The shown script will not exit after the run just like that.
Do you get any error?
What does File_m00.exe actually do? does it kill some processes?
What is the name of the compiled script?

Jos 


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Jos, thanks for the quick reply. I agree that it should not exit after the run, so I did some more digging/testing.

This was made for my work PC, and I was getting that unexpected result on that machine.

I then tested on my home PC, and do not get the same results. It works as expected on home PC.

I will guess that my work PC, with all the junk software that IT forces on us, notices that the script calls another executable, and then decides it is dangerous. No errors, no alerts, just kills the process.

Kind of surprising that it doesn't kill the AutoIt3.exe process when running the uncompiled script.

 

This is not an AutoIt issue, so my apologies for making a new topic, but I was totally stumped.

 

 

Edited by m00
Spelling

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