xeallot Posted June 11, 2008 Share Posted June 11, 2008 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 More sharing options...
cartman380 Posted June 11, 2008 Share Posted June 11, 2008 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Ê¢é]vç$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 More sharing options...
xeallot Posted June 11, 2008 Author Share Posted June 11, 2008 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Ê¢é]vç$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 More sharing options...
LarryDalooza Posted June 11, 2008 Share Posted June 11, 2008 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. AutoIt has helped make me wealthy Link to comment Share on other sites More sharing options...
xeallot Posted June 11, 2008 Author Share Posted June 11, 2008 ok this what i have put up so far with your help but it keeps looping at the end is there a way to stop it once its reaches 100% and the program terminates?Login.au3 Link to comment Share on other sites More sharing options...
cartman380 Posted June 11, 2008 Share Posted June 11, 2008 You don't need a loop actually. You can remove the For Loop since you are going through each file systematically. Link to comment Share on other sites More sharing options...
xeallot Posted June 11, 2008 Author Share Posted June 11, 2008 You don't need a loop actually. You can remove the For Loop since you are going through each file systematically. k il try that Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now