Discussion Locked

scheduling Disk Defragmenter in Win2000

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

The task scheduler in Win98 allowed one to schedule Disk Defragmenter to run at a particular time.

After upgrading to Win2000 (from NT), I tried to use Task Scheduler to defrag, choosing the program to run from:
C:\wint\System32\dfrg.msc

Unfortunately, task scheduler only launches the defragger application, ie the defrag program just sits idle, ie doesn't start defragging!!

Is there any switch that causes the program to start defragging automatically ? Or how can I schedule it to actually *run* ?!

7 replies

by dklippert

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

by ann777

One of the limitations of Defrag in Windows 2000 is that cannot be scheduled or scripted, for the rest of limitations, read :

MSKB Q227463

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q227463&id=227463&SD=MSKB

You can use an 'AutoDefrag' utility to launch Defrag from the command line/batch file which can be obtained from :

http://www.morphasys.com/autodefrag/

You can copy it to Winnt folder and go to Start --> Run --> C:\WINNT\AutoDeFrag.exe C:

You can use also try 'contig' ; a freeware utility from System Internals which takes a slightly different approach:
http://sysinternals.com/ntw2k/freeware/contig.shtml

This discussion is closed to new replies.