Sign in to follow this  
Followers 0
boogieoompa

ProcessClose lag

10 posts in this topic

I am trying to close and relaunch one of my compiled scripts (with updates) but processclose seems to lag. So I added a splash screen while it is closing but it seems to wait until the splash screen disappears. Is this a glitch or am I doing something wrong?

Thanks,

ProcessClose("myscript.exe")
    MsgBox (0,"Relaunch","Please wait while your changes are updated",10)
    Run("myscript.exe")

Share this post


Link to post
Share on other sites



I am trying to close and relaunch one of my compiled scripts (with updates) but processclose seems to lag. So I added a splash screen while it is closing but it seems to wait until the splash screen disappears. Is this a glitch or am I doing something wrong?

Thanks,

ProcessClose("myscript.exe")
    MsgBox (0,"Relaunch","Please wait while your changes are updated",10)
    Run("myscript.exe")
Out of curiousity, if you close your process, it stops at that line, how do you expect to get the msgbox and run to work?

Open SciTe and run these 2 lines:

ProcessClose('AutoIt3.exe')
MsgBox(0,'Info','If you got this msgbox I am impressed')

If you want to restart your script, MHz did one not to long ago.


[center]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.[/center]

Share this post


Link to post
Share on other sites

If you want to restart your script, MHz did one not to long ago.

see Autoit Wrappers for re-start ( in my sig below )

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Actually I have two scripts running one of which is editing the other. Effectivly when the editing script is finished I want to relaunch the other script.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

...while it is closing but it seems to wait until the splash screen disappears...

If the first "it" refers to "myscript.exe" then that is working as you scripted.

If the second "it" is your "editing script", then that script is also working as you coded.

After your MsgBox (not splash screen) is closed or times out, "myscript.exe" will run.

What is the problem... please restate your question.

You might also want to take a look at /AutoIt3ExecuteScript:

http://www.autoitscript.com/forum/index.ph...showtopic=22531

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

Sorry I could have phrased this a little better, effectivly the Processclose command does not execute before the msgbox or run command works. Basically the msgbox is running while the other script is running (even though it should have already been closed). When the run command is executed there are two incedences of the script (one of which closes out after a second or so)

Share this post


Link to post
Share on other sites

Sorry I could have phrased this a little better, effectivly the Processclose command does not execute before the msgbox or run command works. Basically the msgbox is running while the other script is running (even though it should have already been closed). When the run command is executed there are two incedences of the script (one of which closes out after a second or so)

ProcessWaitClose()? :D

Nomad :D


Share this post


Link to post
Share on other sites

Like Nomad mentioned, there is ProcessWaitClose()

...from the help file on ProcessWaitClose:

The process is polled approximately every 250 milliseconds

or if you are in a hurry:
Do
    ProcessClose("myscript.exe")
    Sleep(10)
Until Not ProcessExists("myscript.exe")

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

Thanks, I feel pretty dumb for having over looked that. It is still kind of wierd that it takes that long.

Thanks again

Share this post


Link to post
Share on other sites

Just so every knows (if anyone cares) the task tray has a lag from the process list so when a process is killed it still looks like it is running for a few seconds.

Just an FYI.

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