Y
Y
Yuri2015-09-16 12:56:25
C++ / C#
Yuri, 2015-09-16 12:56:25

Why is the wrong %errorlevel% being returned?

I use this old time-mem utility to measure the execution time of some command from the command line.
It's just a c++ project, the main code is here .
I start to check, for the test I run timemem 7z some-err-str.
It is clear that an error is displayed, it shows code 7, this code is returned.
But in the batch file, if I print echo %errorlevel% right after this command, I get 0.
In general, it behaves the same as a similar ptime utility.
Why, I have no explanation. And most importantly, how can you fix it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Y
Yuriy, 2015-09-16
@yshinkarev

Yes, it was a stupid mistake. And I went to look in a completely different direction. info() always returned 0.

A
Alejandro Esquire, 2015-09-16
@A1ejandro

try replacing the batch file with cmd's file.... and read the usage syntax....

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question