Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to defrag my work PC daily and would like to do this while I'm not at work. I know how to schedule a task but this requires the Defrag UI. How can I automate Defrag to run without user interaction?

share|improve this question

migrated from stackoverflow.com Sep 15 '10 at 0:46

This question came from our site for professional and enthusiast programmers.

4  
Defragmentation is not necessary on modern file systems any more, at least not daily (unless maybe in extreme cases involving hundreds of thousands of small files or something.). Not sure whether this is a good idea. –  Pekka 웃 Sep 14 '10 at 15:30
    
@P....thanks for the advice. But my box needs it at least every other day. –  MikeTWebb Sep 14 '10 at 15:35
1  
you might want to check first if you have a solid-state drive? :) –  Joset Sep 14 '10 at 15:44
1  
I'm pretty sure a de-frag on a sold state drive is not a good idea... –  AkkA Sep 15 '10 at 0:52
1  
@MikeTWebb Don't defrag a solid state drive! It's pointless and in fact causes more harm than good. A SSD can access data all over the drive simultaneously, there's no reason for defrag like in a sequential storage device like a hard disk. If you defrag you are shortening the life of the drive and performing extra writes, which will slow the drive's write speed over time. For more info on this, check out the SSD articles on anandtech.com. –  Robert S Ciaccio Sep 15 '10 at 1:11

3 Answers 3

You can use "contig.exe" from SysinternalsSuite. It can be run from command line and does not have any GUI.

share|improve this answer

A much simpler and more sensible solution: don't defrag it daily. It's highly unlikely that it needs it.

What makes you think that it needs defragging daily is required? Most modern filesystems don't get fragged very quickly or easily, and a defrag will essentially reduce fragmentation to an aboslute minimum, so doing it again two days later is unlikely to do much unless you have some serious hardware issues.

If it's eg performance issues that are making you think defrag is needed what makes you so sure they're being caused by FS fragmentation?

share|improve this answer

I don't think it's possible to automatically defrag with the Windows defragger; scheduled defrag yes, automatic no. You'll need a commercial defragger that monitors the drives and automatically defrags in the background when necessary (some even monitor and prevent fragmentation during the write process, but that's another topic).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.