Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Win2008-R2 Commands
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 22:14pm

1 solution

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

Solution 1

use /OUT:<Path><filename>
  Permalink  
Comments
manas.thombare at 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
0 Maciej Los 295
1 OriginalGriff 259
2 Sergey Alexandrovich Kryukov 205
3 Aajmot Sk 187
4 Sinisa Hajnal 176
0 OriginalGriff 7,800
1 Sergey Alexandrovich Kryukov 7,072
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,790


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 9 Jul 2010
Copyright © CodeProject, 1999-2014
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