QUOTE (phaolo @ Jul 12 2008, 04:46 AM)

Wow the script is perfect that way, thanks!

Nice things the "Interpreter" and "infinite while" solutions (I couldn't understand before why that bar disappeared)
Your welcome

QUOTE
I still have the second problem though, because I'm running actbar.exe from a batch file.
I have to use it as I'm doing registry modifications and various operations. Converting all to a script would be long and full of new errors. Putting it in another script would be a poor solution (multiple files).
I am guessing the batch file is a CMD file? That is fine. No matter what type of script that you use, the method of executing Actbar.exe from that script will be basically the same.
QUOTE
Anyway, with the batch the execution stops after the first script launch.
I don't know why, dos shouldn't wait for program termination normally! (only with start /wait)
What the.. ??
Not AFAIK with the NT based interpreter.
- The CMD interpreter will wait for an execution until processing the next line when a CMD script is used as to invoke the CMD interpreter initially. I notice some particular executions do return immediately as to possibly respawning a new process or some other unknown reason so using Start /wait tends to handle these more reliabily to prevent the immediate return. The default behavior allows the CMD script to complete the command on the line before progressing with the next line.
- An execution from a CMD prompt will not wait for an execution unless you use Start /wait. The default behavior allows you to do multiple commands without waiting for the CMD prompt.
QUOTE
I'll add a batch example so you can see the problem.
(You won't reach the first pause

)
Try this CMD script
CODE
Start actbar.exe 10 1
pause
Start actbar.exe 10 3
pause
Start actbar.exe 10 6
pause
Start actbar.exe 10 10
While I think of it, a 2nd WinClose maybe needed within the AutoIt script during RunOnceEx period as the 1st seems to get ignored for some reason at that time. Modified the code below to handle the WinClose in a loop.
CODE
If $CMDLINE[0] <> 2 Then
; Exit if 2 parameters were not used
Exit 1
Else
; assign parameters to friently variable names
Global $Max = $CMDLINE[1]
Global $Counter = $CMDLINE[2]
; show progress window
ProgressOn("Status", "", "")
; set data to progress window
ProgressSet(($Counter / $Max) * 100, "", "Completed " & ($Counter / $Max) * 100 & "%")
; title to use for the interpreter window title
Global Const $AUTOIT_TITLE = @ScriptName & '_Interpreter'
; close any previous progress windows
If WinExists($AUTOIT_TITLE) Then
Do
; attempt to close the previous progress window
WinClose($AUTOIT_TITLE)
; perform a sleep if window still exists
If WinExists($AUTOIT_TITLE) Then
Sleep(500)
EndIf
; exit the loop if the window does not exist
Until Not WinExists($AUTOIT_TITLE)
EndIf
; set current window as the main interpreter window title
AutoitWinSetTitle($AUTOIT_TITLE)
; if max is reached, then exit
If $Counter = $Max Then
Sleep(2000)
Exit
EndIf
EndIf
; keep the current process running
While 1
Sleep(250)
WEnd
I expect that you will need to use Start without the wait switch in your CMD file to execute Actbar.exe so the CMD interpreter can progress to the next line of execution which the latter is the one that you want to wait for.