I am trying to redirect the output of two commands chkdsk and defrag from command prompt to one txt file like c:> defrag c: >log.txt.
Its behavior is normal on windows xp. The output is coming sequential into the file.
However on Windows Server 2008 R2 chkdsk works fine but when execute defrag then for some initial time file remains blank and suddenly it fills with bunch of text. I want it sequential in the same way as Windows XP.
If we run defrag s exe on windows Server 2008 R2 without redirection then we get sequential output on screen.
Case 1: Directly run the command on command prompt
Windows Disk Defragmenter
Copyright (c) 2007 Microsoft Corp. and Executive Software International, Inc.
Case 2: Run the command on command prompt and redirect the output to a file
C:>defrag c:>log.txt(In this case file remain blank until the command is completed)
What can I do so that it comes sequential into the file?