Knowledgebase

status_loader

How can I redirect the output from the console to a file?

Question / Problem

I want to redirect the output from an automated and unattended run of TreeSize to a file, so I can review it later if needed. Is that possible?

Answer / Solution

Starting TreeSize from a command line (cmd.exe), you can use the pipe-notation to redirect output from the standard output stream (1) and standard error stream (2) to a file. E.g.:

TreeSize.exe /NOGUI C:\ 1>StdOut.txt 2>StdErr.txt

From the PowerShell, it's recommended to use the Start-Process command with matching parameters:

Start-Process -FilePath .\TreeSize.exe -ArgumentList "/NOGUI C:\" -RedirectStandardOutput ".\StdOut.txt" -RedirectStandardError ".\StdErr.txt"

Need further help getting started?

You did not find what you were looking for? Please contact us so we can provide an answer to your question.

Contact Form