now here is a way of enabling automatic defragmentation,it makes your work simpler and saves your time while you been working on other tasks.
From the Control Panel
*Start > Control Panel -> Performance and Maintenance.
*Select Scheduled Tasks and double-click on ‘Add Scheduled Task'.
*when this opens in a new window click on the Next button and then Browse to C:\WINDOWS\system32.
*Click defrag.exe and then the Open button.
*Now give it a name and set the frequency with which the defrag must run. Follow it to Finish.
*An icon with the name you have given appears in the right pane. Right click on the icon and select Properties.
*In the Run text box, you can add the drive you want to defragment like this: C:\WINDOWS\system32\defrag.exe d:
*Click the OK button and the task will be executed at the scheduled date and time.
we can also shedule this by registry,but you should be a bit extra careful as you are dealing with registry.
*click Start Menu -->Run.
*Type "regedit" and hit Enter.
*In the registry editor select HKEY_LOCAL_MACHINE.
*Navigate to Software\ Microsoft\ Dfrg\ BootOptimizeFunction.
*In the right pane check ‘enable' is present or else create a new one by right clicking in the right pane and select New-> String value.
Type in Enable.
*Now double-click on Enable to bring up a box where you can change the values(set a value).
*Type ‘N' to disable the automatic defrag program or ‘Y' to enable the disk fragmentation to happen automatically.
*close the wizard and restart the windows.