Scheduling Disk Defragmentation is a little different, inasmuch as it doesn’t appear in the default list of software displayed by the the Scheduled Task Wizard.
In this case you need to click Browse and locate the program in the Windows/system32 folder.
Select the frequency …
… the time at which you want the software to be run …
… and your username/password, as before.
Click Finish.
Select the defrag.exe file and click Open.
Note that for a user to be allowed to schedule a task, it is necessary for their associated user account to have a password. If this isn’t the case, the error condition 0x80070005 will result.
See the HOW TO CREATE AND CONFIGURE USER ACCOUNTS tutorial for instructions on how to specify or change a password for an existing user account.