ES
-no-result-error may PRINT something like, Error 9: No results found.
if no results are found
why do that instead of just setting ERRORLEVEL ?
you could do something like 2>nul, but i'd rather not
(& not sure why not, but probably for some reason?)
(does it matter to me that the message gets printed? probably not? so then, why the above?)
i'll also note that something like
> if NOT %errorlevel% EQU 0 goto fin:
does not PRINT anything (it simply goes to fin:)
where
> @if NOT %errorlevel% EQU 0 goto fin:
DOES PRINT
why is that?
2>nul
no, i wouldn't want to do that (well, maybe unless it was an Error 9: case)
because then you wouldn't see something like the IPC message if Everything wasn't running
so...
i guess it's not going to hurt anything if the message happens to turn up.
ES, -no-result-error
Re: ES, -no-result-error
ES writes errors to the standard error file.
By default this is the console.
You can hide error messages with:
2>nul
(redirect error output to nothing)
It's useful for the user to see error messages.
Otherwise, they might have a hard time working out why there are no results.
For full control, use a BAT file, disable error output and check the ERRORLEVEL.
Optionally display your own error messages.
will output the if statement to the console.
will not output the if statement to the console.
You should still see ES output.
The error messages might get in the way if you are redirecting to a file or piping to another program.
In this case, disable error output and handle ERRORLEVEL.
By default this is the console.
You can hide error messages with:
2>nul
(redirect error output to nothing)
It's useful for the user to see error messages.
Otherwise, they might have a hard time working out why there are no results.
For full control, use a BAT file, disable error output and check the ERRORLEVEL.
Optionally display your own error messages.
if vs @if
if
@if
You should still see ES output.
The error messages might get in the way if you are redirecting to a file or piping to another program.
In this case, disable error output and handle ERRORLEVEL.