Force Defrag Of Vista Boot Files
Categories:

To manually force Vista to defrag the boot files (for faster boot times), copy and paste this into a batch file.

  • MUST run as Administrator
  • Do not name the file "defrag.bat"
  • Wait for it to finish. It might take a while. Do not cancel this while it's running!!!

bootopt.bat:

@echo off
:: Originally found here:
:: http://forum.notebookreview.com/showthread.php?p=2737834
echo Optimize boot files for faster startup
echo.
echo MUST run as Administrator
echo.
echo Close ALL running programs before continuing!!!
echo.
pause

echo Defragging boot files...

:: Tell Vista that all applications are idle and it can start a background task
echo Rundll32.exe advapi32.dll,ProcessIdleTasks
Rundll32.exe advapi32.dll,ProcessIdleTasks

:: Do the defrag
echo defrag -b %SystemDrive%
defrag -b %SystemDrive%

echo Done.
echo.
pause