Last Updated on December 24, 2022 by Mathew Diekhake

We already showed you how to run Disk Defragmenter in general so you can run it on a schedule or immediately by choosing to run it manually. Now this tutorial will show you how to run Disk Defragmenter from the command line.

The following tutorial demonstrates how to run Disk Defragmenter from Command Prompt when using a version of the Windows Vista operating system.

How to Run Disk Defragmenter from Command Prompt in Windows Vista

Running the Disk Defragmenter from the command line can give you more options to choose from as well as save time. Here are the commands you can use:

1. Open the elevated Command Prompt window. See this tutorial for all the ways you can open the elevated Command Prompt window: How to Open Elevated Command Prompt in Windows Vista.

2. Run one of the following commands that suits your needs by typing it into the command line and pressing Enter to execute it:

  • Complete List of Commands: defrag.exe -?
  • Defragment the Main Default Drive: defrag.exe c:
  • Defragment All Drives or Volumes: defrag.exe -c
  • Perform an Analysis without Defragmenting: defrag.exe c: -a
  • Perform a Partial Defragmentation of C Drive: defrag.exe c: -r
  • Perform a Partial Defragmentation of All Drives and Volumes: defrag.exe -c -r
  • Perform a Full Defragmentation of C Drive: defrag.exe c: -w
  • Perform a Full Defragmentation of All Drives or Volumes: defrag.exe -c -w
  • Force a Defragmentation on a Drive with Low Space: defrag.exe c: -f
  • Verbose or Detailed Mode: defrag.exe c: -f -v

In conclusion, that is how to run the Disk Defragmenter from Command Prompt in Windows Vista.