Windows includes a Disk Defragmenter tool. Although any user can gain access to the Disk Defragmenter console, the ability to analyze or defragment a volume requires administrator privileges. If you do not have administrator privileges and you try to use Disk Defragmentor, you may receive the following message:
You must have Administrator privileges to defrag a volume.
Disk Defragmenter was designed primarily for stand-alone workstations or servers whose users have the ability to log on locally with administrator privileges.
Disk Defragmenter is not intended to be a tool for administrators to maintain networked workstations. This version is not designed to be run remotely and cannot be scheduled to automatically defragment a volume without interaction from a logged-on user. The only way a non-administrator can defragment a local volume is to run the Dfrg.msc console in the context of a user who has administrator privileges. You can accomplish this by running the following command:
runas /user:firstname.lastname@example.org "mmc dfrg.msc"
The user is prompted for the administrator password. This command may be useful for an administrator who wants to run a defragmentation on a user's computer without forcing the user to log off.