Automating ScanDisk and Disk Defragmenter with Task Scheduler
Q179306
"To configure ScanDisk and Disk Defragmenter to run without user intervention, you can add command-line switches to the properties of a scheduled task. To do so, use the appropriate method:
Configure ScanDisk
1. To configure ScanDisk, double-click My Computer, double-click Scheduled Tasks, and then double-click ScanDisk.
2. In the Command Line box, type the following line
: /noninteractive /silent where is the path to the Scandskw.exe file, and is the letter of the drive you want to scan. ScanDisk runs without user prompts if you use the /noninteractive parameter (switch). The /silent switch removes the summary screen.
For example, you could type the following line:
c:\windows\scandskw.exe c: /noninteractive /silent
Configure Disk Defragmenter
1. To configure Disk Defragmenter, double-click My Computer, double-click Scheduled Tasks, double-click Disk Defragmenter.
2. In the Command Line box, type the following line
: /noprompt /q
where is the location of the Defrag.exe file, and is the letter of the drive you want to defragment. Disk Defragmenterruns without user prompts if you use the /noprompt switch. The /q switch defragments only the files.
For example, you could type the following line:
c:\windows\defrag.exe c: /noprompt /q