It happens so gradually that it is possible not to even notice your computer's performance go down the drain. That's how it happened with me. My hard drive was so filthily fragmented that it could barely limp along.

So a friend of mine suggested I set up a scheduled task to run the defragmenter nightly. I did this, and my the performance smoothed out nicely. I thought I'd pass it along.

Before doing so:

Use at your own risk. I take zero responsibility for consequences good or bad for using this script. It worked fine for me. I run Windows XP.

That said, here's the script, implemented as a command (batch) file. You can copy it from the page, but you'll have to massage the line breaks; or you can download the command file: defrag_setup.cmd (.47 KB). The original script was targeted for a computer with a C:\ and D:\ hard drives. I stripped the scheduled task for the second drive -- I don't have two -- but I left the bit where it computes offsets so that you don't try to defrag every drive at once. If you can get your drive in good condition, it should always defrag in only a few minutes; especially for a home PC that is defragmenting every single night.

@echo off
echo "" -------------------------------------------------------
echo ""  Script for defraging hard drives
echo ""    Use at your own risk :)
echo "" -------------------------------------------------------

SET Start_Time=1
SET Offset_Time=1
SET    Start_Time_C=%Start_Time%
SET /a Start_Time_D=Start_Time+Offset_Time

@echo on
schtasks /Create /tn "Defrag Drive C" /tr
         "C:\windows\system32\defrag.exe C: -f -v"
         /sc daily /st "0%Start_Time_C%:00:00" /ru "System"

 
Categories:

Comments are closed.