Archive: exec, execwait, filescopy, error handling


exec, execwait, filescopy, error handling
Hello,

For error handling using filecopy.
CopyFiles /silent "d:\php\*.*" "c:\php" 11000 $1
iferrors error noerror
error:
call errorbox
noerror:
continue

Function "errorbox"
MessageBox MB_OK|MB_ICONEXCLAMATION|MB_DEFBUTTON1 "Warning!! UnIntended Error:Code $1"
FileClose $0
call exit
FunctionEnd

This '$1' variable will be the internal error code.
BUT
if i use
Exec "'C:\mysql\bin\winmysqladmin.exe' $1"
Does this command 'exec' return a error code automatically without the variable being there or am i right above?

This also appllies to:

ExecWait "D:\myobdc\setup.exe" $1
Will this capture the internal error code like the copyfiles command.

Asch


the docs say "if an error occurs the errorflag is set"

that means after executing the program you can check for erros by "iferrors" the state of the executions isn't saved in a variable


Exec doesn't return the return value of the program executed because it doesn't know when the program finishes, only ExecWait does.