Advanced preferences

Last updated on Jul 3, 2021

On the Advanced tab of the preferences dialog you can enable advanced features and access the main configuration file.

Check Deep action if you would like to process all files ignoring all the options set on the defragmentation and optimization tabs. Usually that does not make sense, but in some cases it is very useful. For instance, if you would like to move everything to the beginning of the disk and pack as tight as possible to prepare the disk for shrinking, just check this option and perform the full optimization then.

If you would like to quickly test the disk processing methods check Quick test mode. No files will be actually moved on the disk, but everything else will work the same way as in normal operation.

To access the most advanced options of UltraDefrag click UltraDefrag configuration file > Edit. Alternatively, you can open the following file manually in your favorite text editor: {installation_folder}\conf\options.lua.

Note

If the program says it cannot open the file, that indicates that most likely you have a 64-bit edition of Windows, but the .lua file extension is associated with a 32-bit text editor. Please install a 64-bit edition of the text editor or associate the .lua extension with the built-in Windows Notepad.

Check the following configuration file which UltraDefrag uses by default for the complete information about all the available options:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
-------------------------------------------------------------------------------
-- UltraDefrag configuration file
-------------------------------------------------------------------------------
-- This file contains all UltraDefrag settings. It controls behaviour
-- of the graphical interface, the Windows Explorer's context menu hander,
-- the automatic defragmentation module and, finally, the boot time interface.
--
-- In most cases there's no need to edit this file manually as all the most
-- useful settings are easily configurable via the settings dialog of the
-- graphical interface.
--
-- This file is written in the Lua programming language. There's no need
-- to learn it thoroughly to edit this file, only basic knowledge is required.
-- To get an idea of how it works we do recommend you to read the official Lua
-- reference manual at https://www.lua.org/manual/5.1/
--
-- Also it's worth mentioning that you can use Unicode characters in strings
-- in this file as UltraDefrag uses an improved version of Lua which supports
-- them. All you have to do is to open this file in the Notepad++ editor and
-- then save it in UTF-8 (without BOM) encoding.
--
-- Also Notepad++ features syntax highlighting which makes it much easier
-- to edit the file. The latest version of Notepad++ can be downloaded
-- for free from http://www.notepad-plus-plus.org/
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
-- 1. Common options
-------------------------------------------------------------------------------
-- These options control behaviour of all the UltraDefrag interfaces
-- mentioned above.
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
-- A. Defragmentation options
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
-- List of semicolon separated paths which have to be defragmented.
-- Examples:
--   in_filter = "*.jpg;*.png;*.gif" -- defragment pictures only
--   in_filter = "?:\\windows\\*"    -- defragment windows folders only
-- Keep it empty ("") or set to "*" to defragment everything.
-------------------------------------------------------------------------------

in_filter = ""

-------------------------------------------------------------------------------
-- List of semicolon separated paths which have to be skipped.
-- Examples:
--   ex_filter = "*temp*;*tmp*;*recycle*"      -- exclude temporary content
--   ex_filter = "*.avi;*.mkv;*\\video_ts\\*"  -- exclude movies
-------------------------------------------------------------------------------

ex_filter = "*system volume information*;*temp*;*tmp*;*recycle*;*dllcache*;*ServicePackFiles*;*Windows.old*;*.log"

-------------------------------------------------------------------------------
-- Popular patterns intended for inclusion in filters.
-- For more extensions visit http://www.fileinfo.com/
-------------------------------------------------------------------------------

archive_patterns = "*.7z;*.7z.*;*.arj;*.bkf;*.bz2;*.bzip2;*.cab;*.cpio;*.deb;*.dmg;*.gz;*.gzip;*.lha;*.lzh;*.lzma;*.rar;*.rpm;*.swm;*.tar;*.taz;*.tbz;*.tbz2;*.tgz;*.tpz;*.txz;*.xar;*.xz;*.z;*.zip"
audio_patterns = "*.aif;*.cda;*.flac;*.iff;*.kpl;*.m3u;*.m4a;*.mid;*.mp3;*.mpa;*.ra;*.wav;*.wma"
video_patterns = "*.3g2;*.3gp;*.asf;*.asx;*.avi;*.flv;*.mov;*.mp4;*.mpg;*.rm;*.srt;*.swf;*.vob;*.wmv"
disk_image_patterns = "*.fat;*.hdd;*.hfs;*.img;*.iso;*.ntfs;*.squashfs;*.vdi;*.vhd;*.vmdk;*.wim"

-------------------------------------------------------------------------------
-- Set these variables to 1 to include patterns defined above to in_filter.
-------------------------------------------------------------------------------

include_archive = 0
include_audio = 0
include_video = 0
include_disk_image = 0

-------------------------------------------------------------------------------
-- Set these variables to 1 to include patterns defined above to ex_filter.
-- By default all the variables are set to 1 because archives, multimedia
-- files and virtual machines rarely benefit from defragmentation.
-------------------------------------------------------------------------------

exclude_archive = 1
exclude_audio = 1
exclude_video = 1
exclude_disk_image = 1

-------------------------------------------------------------------------------
-- Skip fragments bigger than specified.
-- Example:
--   fragment_size_threshold = "20 MB"
-- Set it to an empty string ("") or zero ("0") to process fragments
-- of all sizes.
-------------------------------------------------------------------------------

fragment_size_threshold = "20 MB"

-------------------------------------------------------------------------------
-- Skip files bigger than specified.
-- Example:
--   file_size_threshold = "100 MB"
-- Keep it empty ("") to defragment files of all sizes.
-------------------------------------------------------------------------------

file_size_threshold = ""

-------------------------------------------------------------------------------
-- Skip files having less fragments than specified.
-- Example:
--   fragments_threshold = 5 -- skip files having less than 5 fragments
-- Set this parameter to zero to defragment files regardless of their
-- number of fragments.
-- Note: for solid state drives (SSD) we recommend to set this parameter
-- to 20 to exclude slightly fragmented content which doesn't affect
-- performance.
-------------------------------------------------------------------------------

fragments_threshold = 0

-------------------------------------------------------------------------------
-- B. Optimization options
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
-- File sorting criteria. Available options are: PATH (sort files by path),
-- SIZE (sort files by size), C_TIME (sort files by the creation time),
-- M_TIME (sort files by the last modification time) and A_TIME (sort files
-- by the last access time).
-- Example:
--   file_sorting_criteria = "PATH" -- sort files by path
-------------------------------------------------------------------------------

file_sorting_criteria = "PATH"

-------------------------------------------------------------------------------
-- File sorting order. Available options are: ASC (ascending) and DESC
-- (descending).
-- Example:
--   file_sorting_order = "ASC" -- sort files in ascending order
-------------------------------------------------------------------------------

file_sorting_order = "ASC"

-------------------------------------------------------------------------------
-- Skip files bigger than specified.
-- Example:
--   optimizer_file_size_threshold = "20 MB"
-- Keep it empty ("") to sort out files of all sizes. Though, we do recommend
-- to use the default value ("20 MB") as sorting of big files doesn't affect
-- system performance and just wastes time. Also keep in mind that UltraDefrag
-- needs larger free space gaps to sort out larger files, so in case they are
-- not available on the disk, large files won't get sorted out no matter what
-- value is set for this option.
-------------------------------------------------------------------------------

optimizer_file_size_threshold = "20 MB"

-------------------------------------------------------------------------------
-- Set this option to 1 to ignore all the filters set above.
-------------------------------------------------------------------------------

deep_action = 0

-------------------------------------------------------------------------------
-- C. Miscellaneous options
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
-- Skip disks entirely when their fragmentation level is below than specified.
-- Example:
--   fragmentation_threshold = 10 -- ignore fragmentation level below 10%
-- Set it to zero (0) to process disks regardless of their fragmentation level.
-- Note: this parameter doesn't affect the MFT optimization task.
-------------------------------------------------------------------------------

fragmentation_threshold = 0

-------------------------------------------------------------------------------
-- Terminate the job when the specified time interval elapses.
-- Example:
--   time_limit = "6h 30m"
-- Keep it empty ("") or set to zero ("0") to let the job complete
-- no matter how long will it take.
-------------------------------------------------------------------------------

time_limit = ""

-------------------------------------------------------------------------------
-- The progress refresh interval, in milliseconds. The default value is 100.
-------------------------------------------------------------------------------

refresh_interval = 100

-------------------------------------------------------------------------------
-- Set it to 1 (one) to disable generation of the file fragmentation reports.
-------------------------------------------------------------------------------

disable_reports = 0

-------------------------------------------------------------------------------
-- Set it to 1 to simulate the disk processing. No files will get moved
-- physically, but you'll be able to quickly check how various disk
-- processing algorithms work.
-------------------------------------------------------------------------------

dry_run = 0

-------------------------------------------------------------------------------
-- Set it to DETAILED for troubleshooting, otherwise keep it empty ("")
-- or set to NORMAL. Note that the detailed logging consumes more time,
-- memory and disk space.
-------------------------------------------------------------------------------

dbgprint_level = ""

-------------------------------------------------------------------------------
-- Set it to redirect debugging output to a log file. Keep it
-- empty ("") if everything works fine and no logging is needed.
-- Examples:
--   log_file_path = "C:\\Windows\\UltraDefrag\\logs\\ultradefrag.log"
--   log_file_path = ".\\logs\\ultradefrag.log"
-- Environment variables can be used as shown below:
--   log_file_path = os.getenv("TEMP") .. "\\UltraDefrag_Logs\\ultradefrag.log"
-- Note:
--   Unicode characters cannot be included into the log file path.
-------------------------------------------------------------------------------

log_file_path = ".\\logs\\ultradefrag.log"

-------------------------------------------------------------------------------
-- 2. Windows Explorer's context menu options
-------------------------------------------------------------------------------
-- These options control what happens when you defragment
-- files through their context menu in Windows Explorer.
-------------------------------------------------------------------------------

if shellex_flag then
    -- the context menu handler takes into account everything defined above
    -- as well as options defined here exclusively for it
    log_file_path = "C:\\Program Files\\UltraDefrag\\logs\\udefrag-shellex.log"
end

-------------------------------------------------------------------------------
-- 3. Graphical interface options
-------------------------------------------------------------------------------
-- These options control look and feel of the graphical interface.
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
-- Set it to 1 to minimize the application's window
-- to the taskbar notification area (system tray).
-------------------------------------------------------------------------------

minimize_to_system_tray = 0

-------------------------------------------------------------------------------
-- Set it to 1 to show a taskbar icon overlay on Windows 7 and more recent
-- Windows editions. This overlay will reflect the state of the running job
-- in real time.
-------------------------------------------------------------------------------

show_taskbar_icon_overlay = 0

-------------------------------------------------------------------------------
-- Set it to 1 to enable progress indication inside of the taskbar
-- button on Windows 7 and more recent Windows editions.
-------------------------------------------------------------------------------

show_progress_in_taskbar = 1

-------------------------------------------------------------------------------
-- Set it to zero if menu icons look untidy on your system.
-- Note: restart the program after adjustment of this parameter.
-------------------------------------------------------------------------------

show_menu_icons = 1

-------------------------------------------------------------------------------
-- Size of the cluster map cells, in pixels. The default value is 4.
-------------------------------------------------------------------------------

map_block_size = 4

-------------------------------------------------------------------------------
-- Width of the grid line, in pixels. The default value is 1.
-------------------------------------------------------------------------------

grid_line_width = 1

-------------------------------------------------------------------------------
-- The grid line color, in RGB format. Black (0;0;0) is used by default,
-- visit http://www.colorpicker.com/ to pick others.
-------------------------------------------------------------------------------

grid_color_r = 0
grid_color_g = 0
grid_color_b = 0

-------------------------------------------------------------------------------
-- The free space color, in RGB format. White (255;255;255) is used by default,
-- visit http://www.colorpicker.com/ to pick others.
-------------------------------------------------------------------------------

free_color_r = 255
free_color_g = 255
free_color_b = 255

-------------------------------------------------------------------------------
-- The shutdown confirmation timeout, in seconds. The default value
-- is 60, set it to zero to skip any confirmation. Note: it works
-- the same way when you confirm hibernation, logoff or reboot.
-------------------------------------------------------------------------------

seconds_for_shutdown_rejection = 60

-------------------------------------------------------------------------------
-- The following option has been retired: restore_default_window_size.
-- Remove the width and height parameters from the {installation folder}\gui.ini
-- file manually to restore the default window size on the next startup.
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
-- 4. Automatic defragmentation options
-------------------------------------------------------------------------------
-- These options control automatic defragmentation. Don't modify them
-- directly, open the Settings dialog in UltraDefrag GUI instead,
-- adjust automatic defragmentation options there and then click OK.
-- The program will save the options and generate the auto-defrag.cmd
-- script taking them all into account.
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
-- Being set to 1 this option enables automatic defragmentation.
-------------------------------------------------------------------------------

auto_defrag_enabled = 1

-------------------------------------------------------------------------------
-- List of drives to defragment automatically.
-------------------------------------------------------------------------------

auto_defrag_drives_list = "C"

-------------------------------------------------------------------------------
-- Being set to 1 this option forces the automatic defragmentation module
-- to use the custom script.
-------------------------------------------------------------------------------

auto_defrag_use_custom_script = 0

-------------------------------------------------------------------------------
-- 5. File fragmentation reports options
-------------------------------------------------------------------------------
-- These options define what happens when you open a file fragmentation
-- report, either from the graphical interface or from Windows Explorer.
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
-- Set it to zero to disable HTML reports generation.
-------------------------------------------------------------------------------

produce_html_report = 1

-------------------------------------------------------------------------------
-- Set it to 1 to enable generation of plain text reports.
-------------------------------------------------------------------------------

produce_plain_text_report = 0

-------------------------------------------------------------------------------
-- Set it to 1 to split long paths in HTML reports to few
-- shorter lines (for better appearance on small screens).
-------------------------------------------------------------------------------

split_long_names = 0

-------------------------------------------------------------------------------
-- Maximum number of characters per line. The default value is 50.
-- Note: this parameter is ignored when split_long_names is set to 0.
-------------------------------------------------------------------------------

max_chars_per_line = 50

-------------------------------------------------------------------------------
-- To adjust style of HTML reports edit the following file:
-- {installation folder}\scripts\udreport.css
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
-- this number helps to upgrade configuration file correctly, don't change it
-------------------------------------------------------------------------------

version = 302

-------------------------------------------------------------------------------
-- this code concatenates filter variables, don't modify it
-------------------------------------------------------------------------------

orig_ex_filter = ex_filter
if exclude_archive ~= 0 then ex_filter = ex_filter .. ";" .. archive_patterns end
if exclude_audio ~= 0 then ex_filter = ex_filter .. ";" .. audio_patterns end
if exclude_disk_image ~= 0 then ex_filter = ex_filter .. ";" .. disk_image_patterns end
if exclude_video ~= 0 then ex_filter = ex_filter .. ";" .. video_patterns end

orig_in_filter = in_filter
if include_archive ~= 0 then in_filter = in_filter .. ";" .. archive_patterns end
if include_audio ~= 0 then in_filter = in_filter .. ";" .. audio_patterns end
if include_disk_image ~= 0 then in_filter = in_filter .. ";" .. disk_image_patterns end
if include_video ~= 0 then in_filter = in_filter .. ";" .. video_patterns end

-------------------------------------------------------------------------------
-- this code sets environment variables for UltraDefrag, don't modify it
-------------------------------------------------------------------------------

-- common variables
os.setenv("UD_ORIG_IN_FILTER",orig_in_filter)
os.setenv("UD_ORIG_EX_FILTER",orig_ex_filter)
os.setenv("UD_EXCLUDE_ARCHIVES",exclude_archive)
os.setenv("UD_EXCLUDE_AUDIO",exclude_audio)
os.setenv("UD_EXCLUDE_VIDEO",exclude_video)
os.setenv("UD_EXCLUDE_DISK_IMAGES",exclude_disk_image)
os.setenv("UD_IN_FILTER",in_filter)
os.setenv("UD_EX_FILTER",ex_filter)
os.setenv("UD_FRAGMENT_SIZE_THRESHOLD",fragment_size_threshold)
os.setenv("UD_FILE_SIZE_THRESHOLD",file_size_threshold)
os.setenv("UD_FRAGMENTS_THRESHOLD",fragments_threshold)
os.setenv("UD_SORTING",file_sorting_criteria)
os.setenv("UD_SORTING_ORDER",file_sorting_order)
os.setenv("UD_OPTIMIZER_FILE_SIZE_THRESHOLD",optimizer_file_size_threshold)
os.setenv("UD_DEEP_ACTION",deep_action)
os.setenv("UD_FRAGMENTATION_THRESHOLD",fragmentation_threshold)
os.setenv("UD_TIME_LIMIT",time_limit)
os.setenv("UD_REFRESH_INTERVAL",refresh_interval)
os.setenv("UD_DISABLE_REPORTS",disable_reports)
os.setenv("UD_DBGPRINT_LEVEL",dbgprint_level)
os.setenv("UD_LOG_FILE_PATH",log_file_path)
os.setenv("UD_DRY_RUN",dry_run)

-- GUI specific variables
os.setenv("UD_SECONDS_FOR_SHUTDOWN_REJECTION",seconds_for_shutdown_rejection)
os.setenv("UD_SHOW_MENU_ICONS",show_menu_icons)
os.setenv("UD_SHOW_TASKBAR_ICON_OVERLAY",show_taskbar_icon_overlay)
os.setenv("UD_SHOW_PROGRESS_IN_TASKBAR",show_progress_in_taskbar)
os.setenv("UD_MINIMIZE_TO_SYSTEM_TRAY",minimize_to_system_tray)
os.setenv("UD_MAP_BLOCK_SIZE",map_block_size)
os.setenv("UD_GRID_LINE_WIDTH",grid_line_width)
os.setenv("UD_GRID_COLOR_R",grid_color_r)
os.setenv("UD_GRID_COLOR_G",grid_color_g)
os.setenv("UD_GRID_COLOR_B",grid_color_b)
os.setenv("UD_FREE_COLOR_R",free_color_r)
os.setenv("UD_FREE_COLOR_G",free_color_g)
os.setenv("UD_FREE_COLOR_B",free_color_b)

-- automatic defragmentation specific variables
os.setenv("UD_AUTO_DEFRAG_ENABLED",auto_defrag_enabled)
os.setenv("UD_AUTO_DEFRAG_DRIVES_LIST",auto_defrag_drives_list)
os.setenv("UD_AUTO_DEFRAG_USE_CUSTOM_SCRIPT",auto_defrag_use_custom_script)

-------------------------------------------------------------------------------
-- END OF FILE
-------------------------------------------------------------------------------