1

I am creating a batch file to run chkdsk on every drive and log the output to a single file.

I am able to run a chkdsk and log it to a file with:

chkdsk a: > %userprofile%\desktop\test.log

However I am struggling to work out how to then run a new chkdsk and log that output to the same file.

1 Answer 1

0

How do I run a new chkdsk and log that output to the same file.

You need to use a different redirection operator.

The >> operator will append to a file.

Example:

chkdsk a: > %userprofile%\desktop\test.log
chkdsk b: >> %userprofile%\desktop\test.log

Redirection

command > filename       Redirect command output to a file
command >> filename      APPEND into a file

Source Command Redirection, Pipes - Windows CMD - SS64.com


Further Reading

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .