Re: Redirecting command output to environment variable and tracking errorlevel




yairinbal@xxxxxxxxx wrote:
On Feb 22, 4:24 pm, "Tom Lavedas" <tglba...@xxxxxxx> wrote:
mycmd > %temp%\out.txt
set RC=%Errorlevel%
for /f "delims=" %%a in (%temp%\out.txt) do set Output=%%a
del %temp%\out.txt
echo %Rc%
echo %Output%

Hello,

I there a way doing it without using temporary files. The output of
mycmd is sensitive and I would like it to be stored on files?
It looks like a simple requirement to catch an output and return code
from a cmd but appearently it doesnt... only one line in perl...

You could possibly set RC based on the output returned but you will need to
provide more details about what mycmd does, what output and respective
errorlevels it returns, etc. Without this information you are pretty much on
your own.

--
Todd Vargo
(Post questions to group only. Remove "z" to email personal messages)

.



Relevant Pages


Loading