This often happens when you install a third party defragmenter like Diskeeper, then on uninstalling, it does not restore the built in one correctly.
To solve this make sure you have your Windows XP installation CD, then go to Start > Run and type cmd. In the new windows type in sfc /scannow. This should check for missing or corrupt files like defrag.exe and ask to replace or repair it. After this your Windows Defragmenter should work just fine.