Autobuild Update
Published 2.14.2007 by ~mattg
After a few runs, I’ve found that the Autobuild script I wrote for building automatically at night seems to work like a charm. One thing I thought to add which I’ll probably post is a small function that does the following on each logical drive on the local machine:
- Runs the Windows Disk Defragmentor (defrag.exe) in analyze mode
- Parses the output of the analysis to determine the fragmentation percentages
- Checks the fragmentation percentage against a user-defined lower limit
- If the fragmentation percentage exceeds the limit, defrag.exe is run to defragmentment the disk and the output is parsed to report the resulting fragmentation percentage (which should be 0)
Information from this process (and the others) is written to an html log file and emailed to me prior to machine shutdown. I’ve run the script twice already with no problems and the expected results.
Before I post the defrag script, I want to integrate Sysinternals PageDefrag into the script. It’s a tool that allows you to analyze and schedule defragmentation of page files and registry hives on your next boot. I may work on that today while I’m home so that I can post the defrag script when I get back in to work tomorrow, as it’s a pretty useful tool for keeping your disk defragmented without running defrag too many times on the disk.
Filed under Windows