Windows 7 - What does "defrag.exe -c -i" do?

Asked By bryantyler on 02-Oct-07 10:27 AM
%windir%\system32\defrag.exe -c -i

I have this in my Task Scheduler and was wondering what the -c -i is
for?  I have one drive seperated into 2 partitions (1 main, 1
backup).  Does this command line defrag both C: & D:?  Thanks for any
help.




Ramesh, MS-MVP replied on 02-Oct-07 10:46 AM
Open an elevated Command Prompt, and type "defrag /?" to know more =
details about the parameters used and their description. To open an =
elevated Command Prompt, click Start, click All Programs, click =
Accessories, right-click Command Prompt, and then click Run as =
administrator.

- - - - - -
Microsoft Windows [Version 6.0.6000]
Copyright (c) 2006 Microsoft Corporation.  All rights reserved.

C:\Windows\system32>defrag /?
Description:  Locates and consolidates fragmented files on local volumes =
to
improve system performance.

Syntax:  defrag <volume> -a [-v]
defrag <volume> [{-r | -w}] [-f] [-v]
defrag       -c [{-r | -w}] [-f] [-v]

Parameters:

Value         Description

volume to
be defragmented or analyzed.

-c            Defragments all volumes on this computer.

-a            Performs fragmentation analysis only.

-r            Performs partial defragmentation (default). Attempts to
consolidate only fragments smaller than 64 megabytes (MB).

-w            Performs full defragmentation. Attempts to consolidate all =
file
fragments, regardless of their size.

-f            Forces defragmentation of the volume when free space is =
low.

-v            Specifies verbose mode. The defragmentation and analysis =
output
is more detailed.

-?            Displays this help information.

Examples:

defrag d:
defrag d:\vol\mountpoint -w -f
defrag d: -a -v
defrag -c -v

- - - -

--=20
Regards,

Ramesh Srinivasan, Microsoft MVP  [Windows Shell/User]
Windows=AE Troubleshooting http://www.winhelponline.com


%windir%\system32\defrag.exe -c -i

I have this in my Task Scheduler and was wondering what the -c -i is
for?  I have one drive seperated into 2 partitions (1 main, 1
backup).  Does this command line defrag both C: & D:?  Thanks for any
help.
Mr. Damon A. Jewett replied on 02-Oct-07 03:23 PM
no it only defrags the main drive lol
Sam Kroonenburg [MSFT] replied on 03-Oct-07 01:51 PM
This will defrag all of your volumes that are eligible for defrag.
So, yes, it will  defrag both C: and D:.

If you are manually invoking a defrag using the command line, do not use
the -i flag. Just type "defrag -c"

Thanks,
Sam
Marchy replied on 04-May-08 02:16 PM
So nobody has found out what exactly the "-i" flag does?
It is not documented in the help description.


--
Marchy
SG replied on 04-May-08 11:43 PM
Hi,

From what I've found. but cannot confirm is.......
-i makes defrag run in the background and only if the computer is idle

--
All the best,
SG

Is your computer system ready for Vista?
https://winqual.microsoft.com/hcl/
Mark replied on 05-May-08 06:30 AM
http://blogs.technet.com/filecab/archive/2006/10/19/a-quick-note-about-defrag-exe-parameters.aspx