Yes.

From docs: SHELL sets the value of @ERROR to the exit code of the program that is run.

Try the following.

Code:
;dir of an existing directory
shell "%comspec% /c dir c:\data >nul"
?
? "result=" + @error
? @serror

;dir of an NON-existing directory
shell "%comspec% /c dir c:\dataZZ > nul"
?
? "result=" + @error
? @serror



[edit]

Apparently I did not properly read the desired results. WSHPIPE would be the best solution. then parse the result.

[/edit]


Edited by Howard Bullock (2005-11-23 03:43 AM)
_________________________
Home page: http://www.kixhelp.com/hb/