2

I use PageDefrag to keep my page-file healthy, and have it set to run at every boot with a 1sec timeout. I think it would be really handy to be able to defrag the rest of my machine every-time I tell my machine to shut-down (not restart). If it could activate after windows has killed all the background processes and provide a little information on it's progress it would be very useful.

Is there anything that can do this, or is there a way I can "hook" a batch file/command into the shut-down process to run "defrag.exe"?

Please Note: I'm not looking for something that can defrag then shutdown, but rather initiate the shutdown procedure (to close all running/background apps) and then pause the shutdown to run the defrag while there are no locked files.

1
  • For whatever solution you find: ensure it doesn't interfere with Windows Update, which sometimes runs during shutdown as well?
    – Arjan
    Feb 23, 2010 at 10:53

2 Answers 2

1

I use O&O Defrag and it can do the equivalent: it can shutdown the computer after having run the boot-time defragmentation.

1

You could write a Batch-File which is running f.e. MyDefrag and shuts down the machine afterwards, like this:

C:\PathToMyDefrag\MyDefrag.exe -r "yourSxriptHere"
shutdown -s -f -t 00

The MyDefrag-Script does need the following line it:

WhenFinished(exit)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .