adamfinstorp
adamfinstorp

Reputation: 1677

Log output from unrar.exe to a text file (Batch script)

I am writing a batch script that extracts files and would now like to log the output from unrar.exe to a text file. The output I have in mind are things like failure due to corrupted archives etc. or simply that the operation was successful.

Any ideas on how to solve this?

Thanks in advance!

Upvotes: 2

Views: 1224

Answers (2)

Anthony Miller
Anthony Miller

Reputation: 15920

Just the STDOUT

unrar>"output.txt"

Only the errors (ERROUT)

unrar 2>"errors.txt"

Both STDOUT and ERROUT

unrar 2>&1 "both.txt"

Or both in separate files:

unrar 2>"errors.txt" >"output.txt"

Upvotes: 1

psusi
psusi

Reputation: 221

You use redirection:

unrar > logfile.txt

To also redirect stderr:

unrar > logfile.txt 2>&1

Upvotes: 1

Related Questions