Mail Archives: djgpp/2004/09/17/13:30:19.1
Hans-Bernhard Broeker wrote:
> Rafael García <rafael_no_spam_no_ AT geninfor DOT com> wrote:
>
>> I put this in a C program:
>
>> ret=system("unzip prueba.zip");
>
>> then I write an "unzip.bat" with:
>
>> unzip32 %1 %2 %3 %4 %5 %6
>
>> At execution, unzip32 works OK but return value from system is 1.
>> When I execute unzip.bat from the console, errorlevel from unzip32
>> is 0 but when called from system in the C program, it returns 1.
>
> If you ever want to look at return codes (called "ERRORLEVEL" only
> by MS command line interpreters...), don't go through a .bat file.
> Command.com has an unbelievably stupid feature: it won't tell you
> anything about return levels of batch files, or of the programs
> they executed.
>
> For the case at hand, there's really nothing to be gained by having
> that .bat file --- you could, and should, run unzip32.exe itself,
> directly from your C program, or rename/copy unzip32.exe to
> unzip.exe, if it's just the name "unzip" you're after.
I believe that using 4dos will allow you to do all those things
via a .btm file.
--
"This is a wonderful answer. It's off-topic, it's incorrect,
and it doesn't answer the question." -- Richard Heathfield
"I support the Red Sox and any team that beats the Yankees"
- Raw text -