Pipe error messages into clipboard or file.

Started by dwlott, May 24, 2022, 11:08:12 AM

Previous topic - Next topic

dwlott

Is there a way to capture error messages?
I can pipe the console output with > or | like this:
e:\exiftool\exiftool -MakerNotes= "e:\mySourceFolder\File1.jpg" -o "e:\myTargetFolder\%f.%e" | Clip
e:\exiftool\exiftool -MakerNotes= "e:\mySourceFolder\File1.jpg" -o "e:\myTargetFolder\%f.%e" > "console.txt"

The clipboard or file contains the result of the operation, but if there are errors, those don't get into the pipe. 
Below; see the line that begins with an error, that is what I would like to capture.  The rest makes it into the pipe.

e:\exiftool -MakerNotes= "e:\mySourceFolder\File1.jpg" -o "e:\myTargetFolder\%f.%e"
Error: 'e:/myTargetFolder/File1.jpg' already exists - e:/mySourceFolder/File1.jpg
    0 image files updated
    1 files weren't updated due to errors





StarGeek

Errors go to STDERR. This is part of most command lines on any system. In order to capture them, you can redirect STDERR into a file or into STDOUT

See this article.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

dwlott

Thank you StarGeek.  I found that " 1> e:\exiftool\out.txt 2>&1" gets both STDOUT and STDERR into a file.  I could not figure out how to get both into the clipboard, but I can use the created file just fine.