DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
Command Prompt

Defrag from the Windows Vista Command Line

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Windows Vista includes defrag.exe. Open an elevated Command Prompt, then use defrag C: /A to analyze drive C: without changing it, or defrag C: /U /V to run Vista’s normal defragmentation while showing progress and a detailed report.

Before you run defrag.exe

  • Sign in with an account that belongs to the local Administrators group, or use equivalent administrative credentials.
  • Replace C: with the volume you actually intend to inspect or defragment.
  • Do not run Disk Defragmenter against the same volume while a command-line operation is running; the graphical and command-line tools are mutually exclusive during defragmentation.
  • A locked volume cannot be defragmented. If the file system is marked dirty, run chkdsk first. You can check the status with fsutil dirty query C:.

To open the required console, click Start, type cmd, right-click cmd.exe, and choose Run as administrator.

Vista defrag commands at a glance

Goal Command Result
Display help defrag /? Shows the command’s Vista help text.
Run the default operation on C: defrag C: Defragments the named volume using Vista’s default behavior.
Analyze C: only defrag C: /A Analyzes the volume without performing the defragmentation operation.
Show progress and detailed statistics defrag C: /U /V Runs the operation, displays progress, and prints verbose fragmentation statistics.
Operate on every volume defrag /C Applies the operation to all volumes.
Use normal priority defrag C: /H Runs at normal priority instead of the default low priority.
Track an operation already running defrag C: /T /U /V Tracks the operation and displays progress plus verbose output.

The Vista reference also documents /E (all volumes except those named), /M (parallel background operation), /X (free-space consolidation), and /? (help). Use the Vista-era forms shown above rather than assuming that every switch in a current Windows reference existed in Vista.

Analyze a volume without defragmenting it

Run the analysis

  1. Open an elevated Command Prompt.
  2. Enter defrag C: /A and press Enter.
  3. Read the report before deciding whether to run the operation. To analyze another volume, substitute its drive letter, for example defrag D: /A.

/A requests analysis only; it does not start the defragmentation pass.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400)
  • Easily store and access 2TB to content on the go with the Seagate Portable Drive, a USB external hard drive
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
  • To get set up, connect the portable hard drive to a computer for automatic recognition no software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.

Run Vista’s normal defragmentation

Basic operation

Run defrag C: for Vista’s default behavior. Add /U /V when you want visible progress and verbose fragmentation statistics:

defrag C: /U /V

Vista normally runs the utility at low priority so other work can continue. If you deliberately need normal priority, use defrag C: /H; this can make the operation more intrusive while it is running.

All volumes or selected exclusions

defrag /C targets all volumes. The Vista reference also lists /E for all volumes except those you name. Confirm the target carefully before launching a multi-volume operation.

Rank #2
Seagate Portable 5TB External Hard Drive HDD – USB 3.0 for PC, Mac, PS4, & Xbox - 1-Year Rescue Service (STGX5000400), Black
  • Easily store and access 5TB of content on the go with the Seagate portable drive, a USB external hard Drive
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
  • To get set up, connect the portable hard drive to a computer for automatic recognition software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.

Vista’s default partial pass versus a full pass

What the default does

Microsoft’s Vista engineering clarification describes the default as partial defragmentation: it tries to coalesce file fragments smaller than 64 MB. That number is a threshold in the Vista implementation explanation, not a benchmark or a promise of a particular speed improvement.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

“Without the -w option, defrag will perform partial defragmentation, which means that it will only try to coalesce file fragments smaller that 64 MB.”

Microsoft attributes that wording to Georgi Matev. The explanation says that pursuing additional coalescing can consume more time and free space for relatively little performance benefit; it does not provide a percentage improvement.

Rank #3
Seagate Portable 1TB External Hard Drive HDD – USB 3.0 for PC, Mac, PlayStation, & Xbox, 1-Year Rescue Service (STGX1000400) , Black
  • Easily store and access 1TB to content on the go with the Seagate Portable Drive, a USB external hard drive.Specific uses: Personal
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop. Reformatting may be required for Mac
  • To get set up, connect the portable hard drive to a computer for automatic recognition no software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.

Request work regardless of fragment size

The same Vista-specific explanation identifies -w as the option that bypasses the partial behavior and attempts defragmentation for extents regardless of size. Notice the historical distinction: that article uses hyphen-form switches (-w), while the formal Vista command reference presents slash-form syntax for its documented options. Because -w is described in the engineering clarification rather than the formal command reference, treat it as a Vista-era, non-central option and test it cautiously on systems where that syntax is available.

Choice Fragment coverage Trade-off described by Microsoft
Default: defrag C: Attempts to coalesce fragments below 64 MB. Less work than pursuing every extent; Microsoft says further coalescing generally offers little benefit relative to extra time and free-space use.
Full-style request: -w Attempts defragmentation regardless of extent size. Can require more time and free space; the switch is documented in Vista engineering commentary, not the formal Vista command list.

Useful reporting and control options

Save a report to a text file

Redirect verbose output with the Command Prompt’s normal redirection operator:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

defrag C: /V > FileName.txt

The file is created in the current directory unless you provide a full path, such as C:ReportsVista-defrag.txt. Include /U as well if you want progress output in the redirected report.

Rank #4
Seagate Portable 4TB External Hard Drive HDD – USB 3.0, 1-Year Rescue
  • Easily store and access 4TB of content on the go with the Seagate Portable Drive, a USB external hard drive.Specific uses: Personal
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
  • To get set up, connect the portable hard drive to a computer for automatic recognition no software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.

Track an existing operation

If a defragmentation pass is already running, use defrag C: /T /U /V to track it and display progress and verbose statistics.

Interrupt a running pass

Press Ctrl+C in the Command Prompt to interrupt the operation. Avoid closing the window abruptly; let the utility handle the interruption and then inspect the volume before trying again.

Background and idle behavior

Vista’s scheduled defragmentation task is configured to start only when the machine is idle. The engineering clarification also describes an undocumented -i switch: defrag pauses unless the computer is idle and resumes after several minutes without interactive input. Since -i is not listed in the formal Vista command reference, do not rely on it as the primary or portable command.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
UnionSine 500GB Ultra Slim Portable External Hard Drive HDD-USB 3.0
  • [Upgraded Version] - This external hard drive features a mirrored logo stripe combined with a striped anti-slip design, and the rounded corners of the casing make it easier to grip. The stripes also have a heat dissipation function, ensuring stable and fast data transfer.
  • 【Ultra-thin and quiet】 - The motherboard adopts JMicron 578 noise-free solution, giving you a quiet working environment. Lightweight and portable size designed to fit in your pocket for easy portability.
  • 【Ultra-Fast Data Transfers】 - Pairing this external hard drive with JMicron 578 solution USB 3.0 and USB 2.0 interfaces enables blazing-fast data transfer. It boasts theoretical read speeds of up to 125MB/s and write speeds of up to 103MB/s.
  • 【Plug and Play】 - With no software to install, just plug it in and the drive is ready to use.The hard disk chip is wrapped with an aluminum anti-interference layer to increase heat dissipation and protect data.
  • 【What You Get】 - 1 x Portable Hard Drive, 1 x USB 3.0 Cable, 1 x User Manual, Gift-type shell packaging ,Three-year manufacturer's warranty and free technical support services.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting a failed command

Access is denied

Reopen Command Prompt with Run as administrator and verify that the account has local Administrator membership or equivalent rights.

The volume is locked or dirty

Close applications that may hold the volume open. Check the dirty flag with fsutil dirty query C:; if it is set, run chkdsk as appropriate, restart if Windows schedules a repair, and then retry defragmentation.

The GUI says the volume is busy

Close Disk Defragmenter before starting defrag.exe, and do not reopen it until the command-line operation has finished or been stopped.

The output is too limited

Repeat the command with /U /V, or redirect the verbose output to a text file for later review.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Quick Recap

SaleBestseller No. 1
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400)
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400)
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$119.99
Bestseller No. 2
Seagate Portable 5TB External Hard Drive HDD – USB 3.0 for PC, Mac, PS4, & Xbox - 1-Year Rescue Service (STGX5000400), Black
Seagate Portable 5TB External Hard Drive HDD – USB 3.0 for PC, Mac, PS4, & Xbox - 1-Year Rescue Service (STGX5000400), Black
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$229.99
Bestseller No. 3
Seagate Portable 1TB External Hard Drive HDD – USB 3.0 for PC, Mac, PlayStation, & Xbox, 1-Year Rescue Service (STGX1000400) , Black
Seagate Portable 1TB External Hard Drive HDD – USB 3.0 for PC, Mac, PlayStation, & Xbox, 1-Year Rescue Service (STGX1000400) , Black
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$119.80
Bestseller No. 4
Seagate Portable 4TB External Hard Drive HDD – USB 3.0, 1-Year Rescue
Seagate Portable 4TB External Hard Drive HDD – USB 3.0, 1-Year Rescue
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$151.99

A safe Vista workflow

  1. Open an elevated Command Prompt.
  2. Check the volume’s state with fsutil dirty query C:; repair a dirty volume with chkdsk before defragmenting.
  3. Run defrag C: /A to analyze without changing the volume.
  4. If you proceed, run defrag C: /U /V and leave the graphical defragmenter closed.
  5. Use the default partial behavior unless you have a specific reason to request the Vista-era -w behavior.
  6. Save the report with shell redirection when you need a record, and use Ctrl+C if you must stop the pass.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Read next

Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.