Defragment Multiple Hard drives at Once Without any Software
The Disk Defragment tool in Windows can’t be used to Defrag all your hard drives at once.However,this can be achieved by creating a simple batch File from Notepad.
To create the Batch file to Defrag all your hard drives
Open notepad or any text editor.For each hard drive that you want to defragment add the following code
defrag <hard-drive label>:-f
As for example if you wish to defragment only the d and e drive add the following code
defrag d: –f defrag e: -f
If you need to defragment all your Hard drive include all your drives as shown above.
Save the File as a batch File
To save it as a Batch file enter any file name with the extension .bat .Also remember to save the file as “All files” and Not as a text File.
![]()
When Finished just run the batch file and it will take care of the Defragmentation of your Hard Drive.You can also Trigger this File from a Scheduled task and automate the Job.









