The defragmentation tool that ships with Windows is pretty basic and does not offer features that you may need to make use of. I'm not talking about functionality in regards to defragmenting the hard drive to speed up operations, but about basic functionality that you may need.
One example is that there is no option to defrag multiple partitions or drive at once. If you want to defragment multiple drives, you need to select the option after the defragmention of a drive completes. That's not that great of an option considering that you need to be present to run those commands and that you can't just keep the defrag running during night or at times when the computer is idle.
There is however an option that you have that you can make use of to defragment all of your partitions and drives at once. You can use a little batch file to do that which allows you to run it whenever you need to and it takes care of all drives you add to the batch file.
There are a couple of things you need to know though. You need to run the script with elevated rights which you can do easily by right-clicking on it and selecting to run the file as administrator. Just make sure you do so and everything else should be automatic from that moment on.
I have four partitions with the drive letters C:, D:, E: and F: which means that the batch script will look like the following:
defrag.exe c: -f
defrag.exe d: -f
defrag.exe e: -f
defrag.exe f: -f
You need to edit the list to match the drives that you want to defragment using the batch file. Note that you don't need to include Solid State Drives in the list of drives. Also note, that Windows 10 runs automatic drive optimizations regularly by default.
To create the batch file do the following. Create a plain text document and copy & paste the commands you see above to it.
You may need to modify the drive letters and maybe even add or remove lines so that all of your drives are covered. Change the file extension to bat afterward and make sure you do not have a .txt extension anymore.
Run the file by right-clicking on it and selecting the "run as administrator" option from the context menu.Advertisement
Advertising revenue is falling fast across the Internet, and independently-run sites like Ghacks are hit hardest by it. The advertising model in its current form is coming to an end, and we have to find other ways to continue operating this site.
We are committed to keeping our content free and independent, which means no paywalls, no sponsored posts, no annoying ad formats or subscription fees.
If you like our content, and would like to help, please consider making a contribution:
Ghacks is a technology news blog that was founded in 2005 by Martin Brinkmann. It has since then become one of the most popular tech news sites on the Internet with five authors and regular contributions from freelance writers.