Defrag all Hard drives at once in Windows
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.
Defrag all Hard drives at once in Windows
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:
@echo off
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.
Martin: Thanks! :D I’ll give it a go!
mosey just create a file called defrag.bat and double-click it to execute.
Sorry, newbie here – the line above goes into something called ‘batchfile.exe’ or something?
Thanks :D
Yp, scandefrag it is then! Nice one Khu
This is a good tip; not many people know that you can defrag multiple drives in windows. But even so, the windows defraggers take way too much time to defrag, and often they dont do a good job. (eg. they dont defrag the $MFT AFAIK). The Vista defragger also seems to be crippled wrt available options and progress display.
If you go out of the freeware arena, there are some good defraggers like Diskeeper Pro that make defragging easy and fast. DK gives better options for defragging single or multiple drives, and the defrags are also much faster compared to windows. But Diskeeper’s trump card is the autodefrag mode…set it and forget about manually defragging from that point on. Might sound like hype, but actually works really well.
Or you can just use ScanDefrag:
http://www.blueorbsoft.com/scandefrag/
In Vista you can defrag all volumes with the command:
“defrag -c” from an administrator command prompt .