Click here to Skip to main content
13,000,017 members (49,463 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hi all,
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.
Example: -
Case 1: Directly run the command on command prompt
C:>defrag c:
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?
Posted 8-Jul-10 21:14pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

use /OUT:<Path><filename>
manas.thombare 9-Jul-10 7:20am
can u pls give example

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170624.1 | Last Updated 9 Jul 2010
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100