Jump to content

Run wait


Recommended Posts

hi i am wondering why if in the "RunWait" command if the .exe or .bat files are NULL why doesnt It return 0 and move on to the next one? Is there a way to fix this becuase I looked through the forums and the help file and nothing even touches this topic please help. Here is the code that I am working on. ( the .exe are going to have files they are blank for the time being)

#include <GuiToolbar.au3>

#include <GUIConstants.au3>

#include <file.au3>

RegWrite("HKEY_CURRENT_USER\LoginScript\SyncTime", "TestKey", "REG_SZ", "Hello this is a test")

$button = GUICtrlCreateButton ("Start",75,70,70,20)

GUISetState ()

Sleep(500)

ProgressOn("Logon", "Please wait for the updates to install", "0 percent")

$button = GUICtrlCreateButton ("Start",75,70,70,20)

GUISetState ()

Sleep(500)

For $i = 10 to 100 step 10

sleep(1000)

ProgressSet( $i, $i & " percent")

$val = RunWait(".exe")

ProgressSet(10,10 & " percent ")

; script waits until the exe closes

MsgBox(16, "Program returned with exit code:", $val)

$val = RunWait(".exe")

ProgressSet(20,20 & " percent ")

; script waits until the exe closes

MsgBox(16, "Program returned with exit code:", $val)

$val = RunWait(".exe")

ProgressSet(30,30 & " percent ")

; script waits until the exe closes

MsgBox(16, "Program returned with exit code:", $val)

$val = RunWait(".exe")

ProgressSet(40,40 & " percent ")

; script waits until the exe closes

MsgBox(16, "Program returned with exit code:", $val)

$val = RunWait(".exe")

ProgressSet(50,50 & " percent ")

; script waits until the exe closes

MsgBox(16, "Program returned with exit code:", $val)

$val = RunWait(".exe")

ProgressSet(60,60 & " percent ")

; script waits until the exe closes

MsgBox(16, "Program returned with exit code:", $val)

$val = RunWait(".exe")

ProgressSet(70,70 & " percent ")

; script waits until the exe closes

MsgBox(16, "Program returned with exit code:", $val)

$val = RunWait(".exe")

ProgressSet(80,80 & " percent ")

; script waits until the exe closes

MsgBox(16, "Program returned with exit code:", $val)

$val = RunWait(".exe")

ProgressSet(90,90 & " percent ")

; script waits until the exe closes

MsgBox(16, "Program returned with exit code:", $val)

$val = RunWait(".exe")

ProgressSet(100,100 & " percent ")

; script waits until the exe closes

MsgBox(16, "Program returned with exit code:", $val)

Next

ProgressSet(100 , "Done", "Complete")

sleep(1000)

ProgressOff()

DirRemove("c:\updates", 1)

$var = DriveSpaceTotal( "c:\" )

MsgBox(4096, "HHD Space on C:", $var & " MB")

$b = True =1

$b = False =0

Link to comment
Share on other sites

I noticed on your message boxes you were setting the value returned by $val as the timeout period which I'm not sure if you want to do that. The following code will display the value rather than set that as the timeout period.

MsgBox(16, "Program returned with exit code: " & $val)oÝ÷ Øv¯{*.¶¸vZ()à{h)^¬¶È§¶¡zZ_WjÈjYrÊ¢é]$mçè­çrnf¢¶ØZ¶
²Ê&zØb   bëaÆ®¶­sdbfÆTW7G2gV÷C²æWRgV÷C²FVà b33c·fÂÒ'VåvBgV÷C²æWRgV÷C² &öw&W756WBÃfײgV÷C²W&6VçBgV÷C² ²67&BvG2VçFÂFRWR6Æ÷6W0 ×6t&÷bÂgV÷Cµ&öw&Ò&WGW&æVBvFWB6öFS¢gV÷C²fײb33c·f¤VÇ6P &öw&W756WBÃfײgV÷C²W&6VçBgV÷C² ×6t&÷bÂgV÷C´fÆRæ÷Bf÷VæBgV÷C²¤VæD`
Link to comment
Share on other sites

I noticed on your message boxes you were setting the value returned by $val as the timeout period which I'm not sure if you want to do that. The following code will display the value rather than set that as the timeout period.

MsgBox(16, "Program returned with exit code: " & $val)oÝ÷ Øv¯{*.¶¸vZ()à{h)^¬¶È§¶¡zZ_WjÈjYrÊ¢é]$mçè­çrnf¢¶ØZ¶
²Ê&zØb   bëaÆ®¶­sdbfÆTW7G2gV÷C²æWRgV÷C²FVà b33c·fÂÒ'VåvBgV÷C²æWRgV÷C² &öw&W756WBÃfײgV÷C²W&6VçBgV÷C² ²67&BvG2VçFÂFRWR6Æ÷6W0 ×6t&÷bÂgV÷Cµ&öw&Ò&WGW&æVBvFWB6öFS¢gV÷C²fײb33c·f¤VÇ6P &öw&W756WBÃfײgV÷C²W&6VçBgV÷C² ×6t&÷bÂgV÷C´fÆRæ÷Bf÷VæBgV÷C²¤VæD`

thanx for the help man im eplaceingf the run wait with what you suggested i hope it works :)

Link to comment
Share on other sites

Your version of AutoIt determines the behaviour of "RunWait". Recently the Run...() commands have been modified to execute and continue, setting the value of @error upon failure. Previous versions of AutoIt would crash if a file being Run...() did not exist.

Lar.

f_mrcleansmalm_77ce002.jpgAutoIt has helped make me wealthy

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...