Intro Download and install Frequently Asked Questions Tips and tricks

Homepage







© J.C. Kessels 2009
MyDefrag Forum
May 22, 2013, 04:07:42 pm *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Breaking out the dir/file lists  (Read 1195 times)
Micheal Espinola Jr
JkDefrag Junior
**
Posts: 6


View Profile
« on: March 12, 2010, 06:48:44 pm »

First, Mr. Kessels, thank you for such an excellent and continuously evolving product!  I've been a fan of yours for years.

To the point:  I noticed some duplication across the sample scripts for creating the zone of ignored directories and file types.

Like I do with my own similarly behaving scripts, I created a separate script file for the directory and file listing that I commonly work with, and replaced the existing script code to have !Include PATH! statements to include that single resource file.  Below is an example of what I did to modify your sample script code, along with my extended version of the dir/file list.  Please let me know what you think!  Ultimately I think it will make updates and personal file management easier - and make people less likely to make mistakes editing multiple files containing the same info.

Code: (Example code from FastOptimze.MyD)
  FileSelect
    not(
      Size(50000000,0)
      or (LastAccessEnabled(yes) and LastAccess(,1 month ago))
      !Include "FileSelections.MyD"!
      )
  FileActions
    Defragment(Fast)
    FastFill()
    AddGap(UntilPercentageOfVolumeMultiple(1))
  FileEnd

Code: (FileSelections.MyD)
      or DirectoryName("$*")#          Critical system recovery dirs
      or DirectoryName("$ExchUninstall*$")# Exchange uninstall dir
      or DirectoryName("$MSI*$")#      MSI temp dirs
      or DirectoryName("$NTUninstall*$")# Hotfix/update uninstall dirs
      or DirectoryName("$NTUpdate*$")# Hotfix/update uninstall dirs
      or DirectoryName("$NtServicePackUninstall*$")# Service Pack uninstall dirs
      or DirectoryName("$RECYCLE.BIN")#Deleted items temp dir
      or DirectoryName("$SQLUninstall*$")# SQL uninstall dirs
      or DirectoryName("$hf_mig$")#   
      or DirectoryName(".jagex_cache_32")# Java code cache dir
      or DirectoryName("Config.Msi")#  Installation temp dir
      or DirectoryName("Downloaded Installations")#
      or DirectoryName("Downloaded Program Files")#
      or DirectoryName("Ehome")#       Windows Media Center dir
      or DirectoryName("Fonts")#       Fonts dir
      or DirectoryName("Help")#        Help file dir
      or DirectoryName("I386")#        I386 installation media dir
      or DirectoryName("IME")#         Input Method Editor dir
      or DirectoryName("InstallTemp")# Installation temp dir
      or DirectoryName("Installer")#   Installation temp dir
      or DirectoryName("Installshield Installation Information")
      or DirectoryName("MSOCache")#    Microsoft Office cache dir
      or DirectoryName("RECYCLED")#    Deleted items temp dir
      or DirectoryName("RECYCLER")#    Deleted items temp dir
      or DirectoryName("Recycled")#    Deleted items temp dir
      or DirectoryName("ServicePackFiles")# Service Pack uninstall dir
      or DirectoryName("SoftwareDistribution")#
      or DirectoryName("Speech")#      Speech Recognition files fir
      or DirectoryName("Symbols")#     Symbols file dir
      or DirectoryName("System Volume Information")#
      or DirectoryName("Temp")#        Temporary file dir
      or DirectoryName("Temporary Internet Files")# Internet Explorer temporary file dir
      or DirectoryName("WinSxS")#      Side-by-side Assemblies temp dir
      or DirectoryName("dllcache")#    DLL cache dir
      or DirectoryName("ie7")#         Internet Explorer 7 restore dir
      or DirectoryName("ie7updates")#  Internet Explorer 7 updates dir
      or DirectoryName("windows.old")# Windows upgrade backup dir
      or FileName("*.7z")#             7-Zip archive files
      or FileName("*.arj")#            ARJ archive files
      or FileName("*.avi")#            AVI video files
      or FileName("*.bak")#            Backup copies of files
      or FileName("*.bup")#            Backup files
      or FileName("*.bz2")#            Bzip2 compressed files
      or FileName("*.cab")#            Windows Cabinet archive files
      or FileName("*.chm")#            Compiled HTML files
      or FileName("*.dmp")#            Windows crash debug memory dump files
      or FileName("*.dvr-ms")#         Microsoft Digital Video Recording files
      or FileName("*.flv")#            Flash Video files
      or FileName("*.gz")#             Gzip archive files
      or FileName("*.ifo")#            DVD-Video Disc Infomation files
      or FileName("*.iso")#            ISO image files
      or FileName("*.log")#            Log files
      or FileName("*.lzh")#            LZH archive files
      or FileName("*.mp3")#            MPEG-3 audio files
      or FileName("*.mp4")#            MPEG-4 video files
      or FileName("*.msi")#            Microsoft Installer files
      or FileName("*.msu")#            Microsoft Windows Update files
      or FileName("*.nef")#            Nikon Electronic Format image files
      or FileName("*.old")#            Backup files
      or FileName("*.pdf")#            Portable Document Format files
      or FileName("*.rar")#            RAR archive files
      or FileName("*.rpm")#            Red Hat Package Manager files
      or FileName("*.tar")#            TAR archive files
      or FileName("*.tgz")#            TAR Gzip archive files
      or FileName("*.tmp")#            Temporary files
      or FileName("*.vob")#            DVD Video Object files
      or FileName("*.wav")#            WAVE audio files
      or FileName("*.wma")#            Windows Media audio file
      or FileName("*.wmv")#            Windows Media video file
      or FileName("*.z")#              Compress archive files
      or FileName("*.zip")#            ZIP archive files
      or FileName("~$*.*")#            Microsoft Office temp files

(I like to comment files.  Thanks for making your script language comment-able!)
« Last Edit: March 12, 2010, 06:56:25 pm by michealespinola » Logged

--
ME2
jeroen
Administrator
JkDefrag Hero
*****
Posts: 7155



View Profile WWW
« Reply #1 on: March 12, 2010, 11:54:54 pm »

Thanks for the compliment, I appreciate it!

Yes, there is some duplication between the scripts, and yes, it can be avoided by using the !Include PATH! macro. For many people the standard MyDefrag scripts are the first scripts they see, working examples and a starting point for custom scripts, and in this case I feel that readability is more important than the advantages of having only a single instance. But please feel free to use !Include PATH! in your own scripts.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!