These days, even high-end computers become slow and sluggish and thus impact your day-to-day normal routine job. Though there are several ways that you can use to make your PC fast and efficient, one thing that you must do is “defrag the hard drive” once a week. In this guide, we will let you know how to attain this task by applying the default method or using a batch file.
Defragging HDD not only helps in freeing up disk spaces but can also address or prevent a number of issues from even occurring. Seeing its wide usage, you may create a batch file right on your desktop and run it whenever you feel your device running slow. The best part about using a batch file is that you can defrag multiple disk drives in one go.
What is defragmentation and how often you should do it?
Defragmentation is basically arranging files together into the smallest possible fragments. This is an essential process on all disk drives that move to collect data. For example – hard disks, floppy disk drives, or optical disk media. By doing it, you also free up spaces that can be used by your system to impede the return of fragmentation.
By default, your system is furthering apart files so that it can improve the device’s read and write capabilities. However, as the files are separating from each other, this causes a delay in accessing all the files when required. This is why your PC starts running slow or takes more time to start a chosen program. To fix it then, you must seek defragging all disk drives, especially the root drive. After you defragment the hard drive, all files will come together and your device can read them quickly.
If you had noticed your device running slow, consider defragging all the hard drives. As a general rule, make sure to defragment the hard disk once a month or when the fragmentation reaches 10% or more.
How to defrag Windows 11/10 Hard Drive
To defrag your hard drive on either Windows 11 or 10 PC, follow these easy steps –
- Press WinKey + S to launch the search bar.
- Type “defragment” in the text field, and click upon the top result.
- When the “Optimize Drives” window opens up, select the drive that you want to defrag.
- If the hard drive is not appearing normally, click Advanced View to see if they are hidden.
- After selecting the particular drive, hit the Optimize button.
How to schedule hard drive defragmentation
If you wish, you may set a frequency to hard drive defragmentation. By doing so, you don’t need to optimize drives manually. Here’s how to perform this task –
- First of all, open the Optimize drives window by following the steps discussed above.
- When it launches, locate and click Change Settings under the section – Schedule optimization.
- A pop-up window will come into the view next. You may set the frequency to either of the following – Weekly, Monthly, or Daily.
- Besides, you may also choose a disk drive over which you want to apply this scheduled defragmentation.
That’s it, the system will defrag your hard drive as per your given instructions.
Defrag Hard Drive using a batch file
Though there is nothing wrong with proceeding this way, this might appear boring if you want to defragment more than one drive on your computer. Also, if you want to defrag all your disk drives in one go, this will consume more time. This is where you can create a batch file and run it on your PC at ease –
Proceeding this way, you don’t need to remember the process every time you want to defrag the existing disk drives on your HDD. All you have to do is to keep the batch file on your Desktop Screen and run it whenever the need arises.
Here’s how to defragment a hard drive using a batch file on Windows 11/10 –
- Right-click anywhere on the desktop screen and select New > Text Document. On Windows 11, select New item instead of the New option.
- Doing so will open an empty notepad.
- Copy/paste the following into your newly created text file –
@echo off defrag.exe c: -f defrag.exe d: -f defrag.exe e: -f
Note: We have assumed there are three disk drives on your computer. In case you have less than that, delete the ones that aren’t there. Similarly, if you have more disks on your device, add an additional line and name it as per your disk drive letter.
- Go to the File option and hit “Save as“.
- Select “All files” under Save as type, and put “
defrag.bat
” under the File name.
Now that you have created a batch file, run this file as an administrator to defrag all disk drives available on your PC. Keep this file on the desktop so that you can run it anytime you want.
What cannot be defragmented on Windows 11?
There are certain things that you can’t defrag using whatsoever process. The list includes the following –
- FAT or FAT32 formatted disk drives
- Network or Optical drives
Is it good to defrag the hard drive?
Defragging hard drives is considered good, however, only when it is performed over a period of time. With your device furthering apart files, and you bringing them closer more frequently will have a bad impact on the hard disk. So, we advise doing it optimally.
There’s no need to defrag SSDs as there is no mechanical drive inside them. In case you do it on an SSD that uses flash memory will cause the drive to corrupt faster.