This is a short guide that explains the basic functions of MyDefrag Script Creator (MDSC). A detailed version is in progress.

To create a script with MDSC, three basic steps are required:

  1. Select the volumes to be processed
  2. Splitting the files on the volume into file groups
  3. Set of actions to be executed for each file group

The first point is self-explanatory, there are only few special cases. The management of the file groups will now be explained in more detail.

File groups

Using file groups, files in one volume can be grouped and are then placed in appropriate zones on this volume. For example, all files of a program can placed on one place of the volume (and sorted, if necessary) to shorten the loading time of the program.

Create file groups

File groups are created under "Volumes & Actions" -> "File groups". A common way to group files together is by their file extension (eg. ".mp3") or all files in a folder (eg. "Music").

Easy View

In the easy view there is a toolbar with two columns on the right edge. Files that are selected by the symbols in the left column (with the "+" symbol) will be added to the group. Reversely, the files selected by an icon from the right column (with the "-" symbol) will be excluded from the group.

The order in which files are in- or excluded does not matter: the exclusion symbol is more dominant. I.e. if the folder "Music" is included, but all files with the extension ".mp3" are excluded, then only those files will be included in the group which are in the "Music" folder but do not have the extension ".mp3".

Advanced and free view

In contrast to the easy view, the order of the entries is crucial: The list is strictly processed from top to bottom.

From the second entry on in the list there is a connector visible, which decides how the selection criterion in this line is used in conjunction with the above entries. "Add" means that the files, which are selected by the selection criterion, will be added to the group. "Filter" however, means that only those files are included in the group, which both meet the criteria from all above entries, as well as meet the criterion in the current row.

For example, if the "Music" folder is selected as the first entry and the second entry are all the files with the extension ".mp3" and they are connected with "Filter", then only those files files will be included in the group which are both in the "Music" folder, and which also have the extension ".mp3".
If there is now a third entry created, which selects files with the extension ".wav" and with the connector "Add", then, in addition to the mp3 files in Music folder, all wav files on the entire volume would also be included in the group. If the connector would be set to "Filter", too, then no files will be included in the group, as there is no file which has both the ".mp3" and ".wav" extension.

File group priority

If multiple file groups are created, it is almost impossible to avoid that some groups overlap, so that the file X can be in both group A and group B.
To decide in which zone this file will finally be placed, each group has a different priority. Basically, the higher the priority of a file group, the more files end up in the zone.

If the file X is included in both Group A and Group B, it will be placed in Zone A, if Group A has a higher priority than group B. The priority of a group is independent of the placement on the volume. In this way, for example, large, rarely used files (the so-called "spacehogs") are excluded from other groups, by giving them a higher priority but placing them after all other zones on the volume.

Local and global file groups

Local file groups apply only to the script in which they are defined, global file groups can be used in multiple scripts.

Thus, the group "My Documents" can be defined once and several scripts can used it to always place the same files in a zone. Nevertheless, the priority of the group in each script determines how many files actually end up in the appropriate zone.

If a global group is stored within a script file, it will be copied completely into it. If the script is opened again and the global group no longer exists, it can re-imported as a new global group or changed to local.
If a global file group is changed and a script which contains an older version is loaded, you will be asked if, for example, the stored global group should be updated.

Each group has its own MyDefrag version. If a global file group is added to a script, it is automatically converted to the version of the script. This conversion does not count as a change, so that the original and converted file group are still considered equal.

When all file groups are created and the priorities are assigned, they can now be placed on the volume in the "Zones" tab.


In the "Zones" tab, the file groups are converted to the so-called "zones", ie. they get a permanent place on the volume. This depends on the chosen action and the previous zones.


By default, the zones in the list are read from top to bottom, i.e. the first zone is located at the top of the list, the last at the end. This list can also be adapted to the MyDefrag diskmap whereby the first zone is shown at the end (bottom) and the last zone at the beginning (top) of the list. For achieve this, the setting "Flip zone placement view" in Edit> Preferences must be checked. This setting only affects the appearance of the list, not the order in which the zones are placed.

New zones can be added to the list with the "Add a new zone" button. Only so many zones can be added, as there are file groups. Each zone has a zone number, indicating the order in which it is processed.

Usually, the first zone is located at the beginning of the volume, all other zones follow directly behind it. By adding settings before the zones, they can be placed at any point on the volume. For example, the default MyDefrag scripts place the first two zones (MFT and directories) at 30% in the used space of the volume. The following zones will then be placed from the beginning of the volume.

Note that once a zone is placed, it's files will no longer be moved, i.e. the first two zones in the above example are not affected by the subsequent zones. Instead of the two zones being moved again to make way for the subsequent zones, they will be placed around the two zones.


Once a zone has been added, different actions can be set for them. In the simple view, the most common actions are shown for a zone. These are fairly self-explanatory. It should be noted here, however, that if only the action "Defragment" is selected, the zone is not necessarily placed on one place of the volume but can be widely distributed over it. Here it is advised the the option "Move files to zone" is also checked.

If an action is selected, other options are automatically disabled because they are "incompatible" to the chosen actions. If, for example, "Sort by ..." is selected, the "Defragment" action is disabled, because the sorting already defragments files.

In the Advanced and Custom View, there is no restriction on how the actions can be combined. The actions are executed strictly from top to bottom.

Import and export of scripts

If all zones were placed, they can be exported to a MyDefrag script by selecting Script -> Export. If more than one action has been set up, all or a specific action can then be exported. If more than one action is exported, the action names are attached to both the file name and the title of the script.

It is possible to import MyDefrag scripts by selecting Script -> Import. However, the representation of the imported script in MDSC is heavily dependent on it's complexity and the included comments. I recommend therefore, to not import the scripts created by MDSC again. The scripts should always be stored as a MDSC script instead.