statblaster
30th March 2004 18:14 UTC
having a messagebox display error level
Im not the most savvy programmer out there so please help me out.
Im trying to install a file and then run it using execwait. sometimes it works, sometimes it doesnt. im trying to figure out why and put the right measures in place to ensure that it runs. once the the file update.exe runs, it will change its name to "success.exe" so if its not run, it will still be there as "update.exe". here's the code...
ExecWait "$TEMP\update.exe"
IfFileExists "$TEMP\update.exe" yes
yes:
ExecWait "$TEMP\update.exe"
IfErrors error
error:
MessageBox MB_OK ErrorLevels
Id like to figure out two things here:
1. how do i display the error level in the messagebox?
2. if there is an error i want to loop back to the iffileexists...should i make that a function?
your help is greatly appreciated.
Joost Verburg
30th March 2004 18:15 UTC
To loop back add a label and use Goto.
To display the error level add a parameter with a variable to ExecWait and use it for the message box.
statblaster
30th March 2004 18:21 UTC
hold up
can you help me out a little more? i said i am not the most savvy programmer out there, so i apologize but i need a little more guidance.
Joost Verburg
30th March 2004 18:39 UTC
ExecWait bla.exe $R0
MessageBox MB_OK $R0
statblaster
31st March 2004 00:46 UTC
question
ok, so i did that. and in the messagebox, it says 128 half the times and says 0 half the times. any idea what these are?
Joost Verburg
31st March 2004 09:41 UTC
They are set by the application you are running. You should check the documentation of that application.
Vytautas
31st March 2004 13:20 UTC
0 usually means that the program terminated sucessfully and I can't remember what 128 stands for of the top of my head. But it will usually be an error unless the program is designed to return some special value.
Vytautas