Hello all.
I have a question: I've written a script to defrag my second hard-disk which holds all the directory
for 'My Documents' (Frequent usage - every day), some ISO's/Setups and ghost for my primary disk (which are low usage).
The script is:
Title("Defragment of my Secondary ('My Documents', instalations, setups etc.) drive")
Description("Defragment of my Secondary ('My Documents', instalations, setups etc.) drive")
WriteLogfile("C:\Program Files\MyDefrag v4\Scripts\MyDocsDefrag.LOG","LogHeader")
VolumeSelect
CommandlineVolumes()
and Writable(yes)
and Mounted(yes)
VolumeActions
AppendLogfile("C:\Program Files\MyDefrag v4\Scripts\MyDocsDefrag.LOG","LogBefore")
AppendLogfile("C:\Program Files\MyDefrag v4\Scripts\MyDocsDefrag.LOG",
"-------------------------------------------------------------------------------------------------------------------------------------------
UnMovable:
List:
!UnmovablesList!
Total # of fragments: !UnmovablesTotalFragments!
Total # of bytes: !UnmovablesTotalBytes!
Total # of clusters: !UnmovablesTotalClusters!
-------------------------------------------------------------------------------------------------------------------------------------------")
AppendLogfile("C:\Program Files\MyDefrag v4\Scripts\MyDocsDefrag.LOG", "Deleting journal")
DeleteJournal()
/* Reclaim the NTFS reserved area by moving non-system files to regular diskspace. */
AppendLogfile("C:\Program Files\MyDefrag v4\Scripts\MyDocsDefrag.LOG", "Reclaim the NTFS reserved area by moving non-system files to regular diskspace")
ReclaimNtfsReservedAreas()
# Zone 1 - NTFS system files (such as the $MFT) and a small gap.
AppendLogfile("C:\Program Files\MyDefrag v4\Scripts\MyDocsDefrag.LOG",
"
Proccessing Zone 1 - NTFS system files (such as the $MFT) and a small gap.")
FileSelect
SelectNtfsSystemFiles(yes)
FileActions
PlaceNtfsSystemFiles(Ascending)
FastFill()
AddGap(Megabytes(250))
FileEnd
# Zone 2 - Directories
AppendLogfile("C:\Program Files\MyDefrag v4\Scripts\MyDocsDefrag.LOG",
"
Proccessing Zone 2 - Directories")
FileSelect
Directory(yes)
FileActions
SortByName(Ascending)
AddGap(Megabytes(250))
FileEnd
# Zone 3 - Documents (e.g. "My Documents" located under "Documents")
AppendLogfile("C:\Program Files\MyDefrag v4\Scripts\MyDocsDefrag.LOG",
"
Proccessing Zone 3 - Documents (e.g. 'My Documents' located under 'Documents')")
FileSelect
DirectoryName("Documents")
FileActions
//SortByName(Ascending)
//MoveDownFill()
Defragment(Fast)
FastFill()
AddGap(Megabytes(3000))
FileEnd
# Zone 4 - IIS projects
AppendLogfile("C:\Program Files\MyDefrag v4\Scripts\MyDocsDefrag.LOG",
"
Proccessing Zone 4 - IIS projects")
FileSelect
DirectoryName("IIS")
FileActions
//SortByName(Ascending)
//MoveDownFill()
Defragment(Fast)
FastFill()
AddGap(Megabytes(2000))
FileEnd
# Zone 5 - ALL that is NOT under 'Installations', 'Ghost', 'Documents' or 'IIS'
AppendLogfile("C:\Program Files\MyDefrag v4\Scripts\MyDocsDefrag.LOG",
"
Proccessing Zone 5 - ALL that is NOT under 'Installations', 'Ghost', 'Documents' or 'IIS'")
FileSelect
ALL AND
NOT (DirectoryName("Installations")) AND
NOT (DirectoryName("Ghost")) AND
NOT (DirectoryName("Documents")) AND
NOT (DirectoryName("IIS"))
FileActions
//SortByName(Ascending)
//MoveDownFill()
FastFill()
AddGap(PercentageOfVolumeFree(80))
FileEnd
# Zone 6 - ALL under "Installations" (big instalation files, low usage) or "Ghost" (big backup files (Ghost/TrueImage), low usage)
AppendLogfile("C:\Program Files\MyDefrag v4\Scripts\MyDocsDefrag.LOG",
"
Proccessing Zone 6 - ALL under 'Installations' (big instalation files, low usage) or 'Ghost' (big backup files (Ghost/TrueImage), low usage)")
FileSelect
NOT (ALL) AND
(
DirectoryName("Installations") OR
DirectoryName("Ghost")
) AND
NOT (DirectoryName("Documents")) AND
NOT (DirectoryName("IIS"))
FileActions
Defragment(Fast)
FastFill()
AddGap(PercentageOfVolumeFree(20))
FileEnd
AppendLogfile("C:\Program Files\MyDefrag v4\Scripts\MyDocsDefrag.LOG",
"-------------------------------------------------------------------------------------------------------------------------------------------
UnMovable:
List: !UnmovablesList!
Total # of fragments: !UnmovablesTotalFragments!
Total # of bytes: !UnmovablesTotalBytes!
Total # of clusters: !UnmovablesTotalClusters!
-------------------------------------------------------------------------------------------------------------------------------------------")
VolumeEnd
AppendLogfile("C:\Program Files\MyDefrag v4\Scripts\MyDocsDefrag.LOG","LogAfter")
And it takes forever to finish and even after finish the drive looks pretty fragmented...
Any advice?
Thanks ahead,
D.