Intro Download and install Frequently Asked Questions Tips and tricks

Homepage







© J.C. Kessels 2009
MyDefrag Forum
October 26, 2014, 05:21:58 am *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: "not" not working  (Read 2301 times)
Diago
JkDefrag Junior
**
Posts: 6


View Profile
« on: March 01, 2009, 01:11:55 pm »

Code:
Title ('Defrag Madness')
Description ('C: only')

Slowdown (/*SLOWDOWN*/)
Debug (/*DEBUG*/)
ExitIfOnBatteryPower(no)
LowMemoryUsage(yes)
PreventPowerSaving(yes)
PreventScreenSaving(no)
OtherInstances (exit)
WhenFinished (/*WHENFINISHED*/)

# Optimize C: with 3 zones
VolumeSelect
   Name ("c:")
VolumeActions

   ReclaimMFTzone ()

   # Optimize MFT
   FileSelect
      FileName ("$mft")
   FileActions
      SortByName (Ascending)
   FileEnd

   # Optimize Directories
   FileSelect
      Directory (yes)
   FileActions
      SortByName (Ascending)
   FileEnd

   # zone1 system + apps
   SetBeginOfZone (PlusMegabytes(100))

   // Optimize the system disk for faster booting.
   FileSelect
      ImportListFromBootOptimize ()
   FileActions
      SortByImportSequence (Ascending)
   FileEnd

   // System files
   //FileSelect
   //   System (yes)
   //FileActions
   //   SortByName (Ascending)
   //FileEnd

   // all except spacehogs, media files + downloads by directory name
   FileSelect
      not (DirectoryName("Downloads") or DirectoryName("Downloadz")
              or DirectoryName("DownloadDirector") or DirectoryName("$user") or DirectoryName("VMWare"))
      and not (FileName("*.jpg") or FileName("*.gif") or FileName("*.png"))
      /*SPACEHOGS*/
   FileActions
      SortByName(Ascending)
   FileEnd

   # zone2 media + projects
   SetBeginOfZone (PlusPercentageOfDisk(100))
   
   FileSelect
      not (DirectoryName("Downloads") or DirectoryName("Downloadz") or DirectoryName("DownloadDirector"))
      /*SPACEHOGS*/
   FileActions
      SortByName(Ascending)
   FileEnd
   
   # zone3 spacehogs + downloadz
   SetBeginOfZone (PlusPercentageOfDisk(100))
     
   FileSelect
      all
   FileActions
      Defragment ()
      Fastfill ()
   FileEnd

VolumeEnd

Trying to achieve 3 zones here:
1. System + Applications
2. Media
3. Spacehogs at the end of the disk.

Using the code above I suspect the not unary does not seem to work as I still see files from the excluded directories in the first zone or I'm not understanding things right Wink
Can someone please elaborate? Thx!
Logged
jonib
JkDefrag Hero
*****
Posts: 822


View Profile
« Reply #1 on: March 01, 2009, 06:48:28 pm »

I believe you need to add "All and" before your "Not" or you will not select any files but only exclude files.
Example:
Code:
FileSelect
      All And
      not (DirectoryName("Downloads") or DirectoryName("Downloadz")
              or DirectoryName("DownloadDirector") or DirectoryName("$user") or DirectoryName("VMWare"))
      and not (FileName("*.jpg") or FileName("*.gif") or FileName("*.png"))
      /*SPACEHOGS*/
   FileActions

jonib
Logged

Diago
JkDefrag Junior
**
Posts: 6


View Profile
« Reply #2 on: March 01, 2009, 09:38:13 pm »

Thx Jonib! I've changed my script and I'll test once again. I've noticed that MyDefrag gets stuck even though it does not seem to have finished the job. I've now added LowMemoryUsage(yes) for this.

Also I wonder if the $ character in $user is not recognized as a special char or if I'm seeing a bug you found.

First things first, let's see how things work out now.
Logged
jonib
JkDefrag Hero
*****
Posts: 822


View Profile
« Reply #3 on: March 01, 2009, 09:53:56 pm »

It seems I was mistaken "All and" isn't necessary according to jeroen.

jonib
Logged

jeroen
Administrator
JkDefrag Hero
*****
Posts: 7233



View Profile WWW
« Reply #4 on: March 01, 2009, 11:15:00 pm »

It seems I was mistaken "All and" isn't necessary according to jeroen.
Sorry for my mistake in the other thread! The "All and" is necessary and must be there, 2 times in this script.
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!