Jump to content

defrag.exe "-g" switch


Quark Fusion

Recommended Posts


That's odd. My defrag.exe command in Task Scheduler is %windir%\system32\defrag.exe -c -i, which means the -i is not documented (but -c tells me I'm defragmenting all attached volumes):

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

C:\Users\thisuser>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> Specifies the drive letter or mount point path of the 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

I did some searching and found that -i tells defrag.exe to pause when the machine is not idle (hence -i).

Link to comment
Share on other sites

I read somewhere that -i switch means "work only if system is idle for few minutes", it's not documented because was added after freeze of language packs (still I don't understand why not update language packs, even if they can't do that before release they can do it with windows update)

BTW, my system is Vista x64 SP1.

Link to comment
Share on other sites

  • 8 years later...

I found that Defrag.exe /G does optimization in a tiered layout, i.e., if you have a storage pool containg HDDs and SSDs, it will do a special defragmentation: Frequently accessed data will be stored on the SSDs and the remaining will be on the HDDs.

Check more at What's New in Defrag for Windows Server 2012/2012R2 and at Storage Spaces: How to configure Storage Tiers with Windows Server 2012 R2.

Edited by joaopaulo1511
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...