Directory Toolkit Scripts
(Ver 4.6-4.7)
Funduc Software, Inc
Copyright 1997-2018
www.funduc.com    www.searchandreplace.com 
support@funduc.com      

[Back]

Directory Toolkit scripts may be used for complex or frequent synchronize operations in lieu the synchronize command line switches. You may specify more than one operation in a single script. Script files are ASCII text files that should be created using text editor such as Notepad. You may also write & load single-step scripts interactively from the main dialog via the View Menu (Load/Write options from/to script). A script file may be passed to Directory Toolkit via the /F command line parameter. For example, to run a script in the file "dt.cfg", you would issue the following from a command line prompt or a batch file:

C:\TOOLS\DIRTKT\DIRTKT.EXE /F"c:\script files\dtscript1.cfg" /Q

Directory Toolkit will look for the script file in the current subdirectory. You may specify a path to the script file. The file name extension for the script file may be anything you choose. You may specify the /Q command line parameter when using scripts (example above).


# Comment lines in a script are prefaced with # or ' characters

# in column 1. The comment characters _must_ go in column 1.

# Comments should not be placed after script commands -- keep

# comments on separate lines from your working script switches.

 

# Blank lines are ignored.

 

# Note: All script commands and comments must begin in column 1!!!

 

# GENERAL COMMENTS

# ================

# The [Default] Section, which is optional, is used to specify 
# parameters for all [Action ]s in the script. You can also specify 
# parameters in specific [ActionX] section(s). For example, 
# see [Action3] section below.

 

# All scripts must have at least one [Action ] section!! For this model
# script, [Action1] and [Default] are redundant -- both have the same 
# path settings. In actual use, for single [Action] scripts you would
# not specify [Default] and would instead use [Action1] alone

# If present, [Default] should always be specified first. The order 
# of processing for the [Action ] sections is determined by their number.
# They can be placed in any order within the script. Furthermore, numbers 
# do not need to be inclusive -- you can skip numbers. For example, if 
# your script has [Action8] [Action2] [Action5] they will be processed 
# in the order: [Action2] [Action5] [Action8]. Please see the F1 hlp
# for more information.

 

# If an [Action] number is duplicated, the program will process 
# the first of that number as it is found in the script. For 
# example, in a script with [Action1], [Action2], [Action3], [Action2], 
# the first [Action2] will be processed. The 2nd is ignored.

[Default]

 

# *** PATH SETTING ***

# Note: If Path1= or Path2= setting are listed in [Default], create a 
# [Action1] tag with no Path1= or Path2= setting in order to use 
# Path1= or Path2= as specified in [Default]. 
# If your [Action1] section has a Path1= and Path2= settings 
# they will supercede what is specified in [Default].
Path1=D:\Test\Folder1

Path2=D:\Test\Folder2

 

# Alternate Specification:
# Paths can also be specified in the form of variables that can then
# be employed as needed within specific [Action] sections. For example,
 
# TestPath1=D:\Test\Folder1
# TestPath2=D:\Test\Folder2
# MyDocsForWork=C:\Documents and Settings\BillsWork\My Documents
# DocsForGaming=C:\Documents and Settings\Game Player\My Documents
 
# Paths can also be specified in the form of variables that can then
# be employed as needed within specific [Action] sections. For example,

# TestPath1=D:\Test\Folder1
# TestPath2=D:\Test\Folder2
# MyDocsForWork=C:\Documents and Settings\BillsWork\My Documents
# DocsForGaming=C:\Documents and Settings\Game Player\My Documents

# The variable names can be any string except they must not begin 
# with the # or ' characters and they should not contain spaces

# It is OK to use both forms within a single script. 

# See the program F1 hlp, [Action4] and [Action5] sections 
# below, and the Example4.cfg sample script included with the 
# program for more info.

 

# *** SYNCHRONIZE/COMPARE OPERATION TO PERFORM ***
# If not specified, Default Operation = 6.
# Use only one switch per [ActionX] section. 
# Use a value of 6 (Compare Only) to generate an output report 
# without performing any synchronize operations.

# Note: The - value, 'prompted' switches below bring up the Directory
# Toolkit synchronize dialog, with that function pre-selected. You can 
# then cancel or permit the operation. If you use your script with our 
# Folder Synchronize utility, 'prompted' synchronize is not available
# for that product. Folder Synchronize will instead carry out that 
# 'No Prompt' counterpart. Use Confirm Updates=1 with Folder Synchronize 
# if you want an opportunity for user intervention. 

# To cause Directory Toolkit to display two paths in a compare but take 
# no further action:
# - Make a script with only one [Action]. You must have only one 
#   action, otherwise selecting OK in the synchronize dialog will 
#   cause the program to continue on to the next step.
# - Use Operation=-8 
# - Select the OK button in the Synchronize dialog. 


# Alternatively, use the Directory Toolkit /s and /t command line switches 
# to launch the program on the two paths in question.

#               SWITCH VALUE

#                   No

# OPERATION        Prompt Prompted ACTION

# ---------------- ------ -------- ------------------

# Synchronize        0     -2      Update & Add in both directions.

# Augment            1     -3      Add only new to target.

# Refresh            2     -4      Update only existing in target.

# Update             3     -5      Update & Add new to target.

# Prune              4     -6      Update, Add new, Remove Orphans.

# Remove Identical   5     -7      Remove identical files from target.

# Compare Only       6     -8      Display only - No synch operations.

# Recreate Dirs      7     -9      Recreate directory structure only.

#                                   No other files are copied.

# Delete Empty Dirs  8     -10     Delete empty directories from the

#                                   target. No other files are copied.

# Prompt only              -1      Display synch dialog with no default.

Operation=6

 

 

# *** FILE MASK ***

# File masks are specified with the Mask= switch.  Complex file masks

# can be used. If no mask is specified the default assumed is *.*

# See the Directory Toolkit complex mask dialog for a builder 

# to help you construct complex masks.

#

# Some examples are:

# Mask                 Effect

# -------------------- -------------------------------------

# *.i??                Include files ending with .i followed

#                        by 3 characters

# win.ini              This would be found by the above.

# ~moricons.dll        Exclude this specific file.

# ~\images\te*\        A wildcard (te*) to skip images\test,

#                        images\testing, etc.

# ~\*\junk*\*\*.*      Skips all files in any subdir junk*

#                        and all under that.

#

# All subdir specifications are relative Path1= and Path2=

# Separate multiple specifications with ; character. For example,

# *.*;~\*\junk*\*\*.*

#

Mask=*.*

 

 

# *** PROCESS SUBDIRECTORIES ***

# Use the switch to include or not include subdirectories. If not 
# specified, Default = 1.
# Possible Values:

# 0 = Do not recurse subdirs

# 1 = Include subdirs

Search_subdir=1

 

 

# *** OUTPUT FILE FUNCTIONS ***

# To create an Output File of the results, specify a path & file name

# using the Output File= switch. Leave blank to not write an output file

# To write to the output file in Append mode, also specify 

# Append to Output File=1.

#

# IMPORTANT: Use a path for the output file other than one being used

# during a synchronize operation. If your output file is in a path that

# is being actively synchronized you may get file sharing errors.

#

# It is OK to define different Output Files for each [ActionX] section.

# Possible Values for append switch:

# 0 = Output file is overwritten.

# 1 = Output writes are in append mode.

Output File=

Append to Output File=1

 

# *** REPLACEMENT CONFIRMATIONS ***

# This switch controls whether prompting for replaces is made.
# The Use OS Operations= switch determines the style of the 
# prompting offered. If not specified, Confirm Updates=1
# is assumed. 
# Possible Values:

# 0 = No update prompts for file replacements are supplied.

# 1 = Confirmation prompts will be made.

Confirm Updates=1

 

# *** USE OS vs INTERNAL CONFIRMATION DIALOGS ***

# The Use OS Operations= switch controls the type of file

# confirmation dialog used: internal vs. standard Windows

# dialogs.  The internal dialogs provide more information and

# choices than the native Windows dialogs. Some network drivers

# & removable media may require 'native' mode. If you have

# trouble with subdirs not being created on a path, try

# Use OS Operations=1. 

# The default if not specified is Use OS Operations=0

# Possible Values:

# 0 = Use internal file confirmation dialogs.

# 1 = Use native OS file operations.

Use OS Operations=0

 

 

# *** DISPLAY ERROR MESSAGES ***

# This switch is for future use within Directory Toolkit. 
# If you use Folder Synchronize, the Display Error Messages= switch
# to controls whether or not the program issues small Action
# Completed message boxes after a script is complete. We recommend
# setting this switch to Display Error Messages=1 if you are doing
# operations to/from floppy media because this will help the program
# detect some OS- related driver error messages for some
# manufacturer's drivers such as zip disks, CDRW drives, etc. For
# totally silent operations specify Display Error Messages=0.
Display Error Messages=1

 

# *** BINARY FILE CONTENTS COMPARISON ***

# Use this to perform a byte level contents comparison when two
# files have an alike name but different file date. The files will
# be considered identical if the contents are the same. Enable this
# only if you need it -- because the entire file must be read,
# processing will be slower, especially when network paths are
# involved. If not specified, Check Same Size Files=0 is assumed.
# Possible Values:

# 0 = Do not perform binary file checks.

# 1 = Perform binary file checks.

Check Same Size Files=0

 

# *** BINARY FILE CONTENTS COMPARISON - SAME DATE FILES ***

# To not perform a binary contents check on same date/size files,

# turn off the Binary Check Same Date Files= switch.

# This will speed up operations when Check Same Size Files=1 is

# enabled. However, use this only if you are sure your same

# date/size files are identical. This switch has no effect if

# Check Same Size Files=0 is specified.  If not specified, 
# Binary Check Same Date Files=1 is assumed.
# Possible Values:

# 0 = Do not binary compare same size/date files.

# 1 = Perform binary file compare on all files.

Binary Check Same Date Files=1

 

# *** UNIX COMPARE MODES ***

# Two special 'Unix' Directory Compare modes are available as a

# subset of Binary File Comparison (above) to compare files that

# have matching date/time stamps but different file sizes.  The

# first, 'Ignore Whitespace Compare', disregards whitespace

# including spaces and line terminators. This mode can be used to

# compare Unix vs. PC files that are the same name and have matching

# time/date stamps. The second, 'Ignore Case Compare', disregards

# the case of the text within the files.

#

# Important Notes - Please Read:

# - The Check Same Size Files=1 switch MUST also be specified for

#   either of these switches to work.

# - Ignore Whitespace Compare can be done alone.

# - To use Ignore Case Compare you MUST also enable Ignore Whitespace

#   Compare.

# - The default for both switches if not specified is =0, e.g.,

#   Ignore Whitespace Compare=0, Ignore Case Compare=0

# 

# Settings if you want Unix Compare alone:

# Check Same Size Files=1

# Ignore Whitespace Compare=1

# Ignore Case Compare=0

#

# Settings if you want Unix Compare and Ignore Case Compare:

# Check Same Size Files=1

# Ignore Whitespace Compare=1

# Ignore Case Compare=1

 

# *** DISPLAY DIFFERENT / IDENTICAL FILES ***

# Use these switches to control whether the program includes
# different &/or identical in your synchronize or comparison
# operation. If not specified, Show Different=1 and 
# Show Identical=1 are assumed. 
# Possible Values:

# 0 = Do not include those files

# 1 = Include those files

Show Different=1

Show Identical=1

 

# *** INCLUDE FILES THAT EXIST ONLY IN ONE PATH ***

# Show Files in 1 Dir= is used to control whether orphan files in

# one or the other path are included in an operation. In most

# cases you will probably want Show Files in 1 Dir=1. If not

# specified Show Files in 1 Dir=1 is assumed.

# Possible Values:

# 0 = Do not include files that exist in one dir only.

# 1 = Include files that exist in one directory only.

Show Files in 1 Dir=1

 

# *** OVERWRITE BLOCKS - NEWER &/or OLDER FILES ***

# The two switches below are used to prevent the replacement of

# newer and/or older files. For safety reasons you probably should

# keep 'Newer Overwrite' turned off -- If enabled, a synchronize

# could replace newer files with older versions!!! If 'Newer

# Overwrite' is not specified the program default is disabled.

# 'Older Overwrite' should probably be enabled (this is the

# default). If you disable 'Older Overwrite', older versions of

# files will not be updated with newer versions during a

# synchronize. If not specified, Newer Overwrite=0 and

# Older Overwrite= 1 are assumed.

# Possible Values:

# 0 = Do not overwrite.

# 1 = Allow overwrites.

Newer Overwrite=0

Older Overwrite=1

 

# *** LOCATE SAME NAMED FILES ***

# Use the Match In Subdir=1 switch to enable a special mode to 
# search for duplicate files on your disk, e.g., to scan for 
# duplicate DLLs or ferret out like-named documents across 
# different subdirectories. In general, you would specify the 
# same path for Path1= and Path2= when using this mode, although 
# it is OK to scan two different paths. 
# Do not enable Match In Subdir=1 if you do not need it - the file 
# lists returned are generally not what you would want for a typical 
# synchronize operation. Operation=6, which is a comparison only, 
# is the most common operation usage when Match In Subdir=1 is used. 
# The default is Match In Subdir=0 
# Possible Values:

# 0 = Do not search for duplicate files in the paths.

# 1 = Perform a Match Duplicate Files comparison.

Match In Subdir=0

 

# *** TIME CHECK PRECISION ***

# Because NT-class operating systems such as Windows NT/2000/XP use
# a more accurate time stamp than Windows 95/98, comparisons between
# a Win95/98 and NT-class machine may lead to false mismatches a
# second apart (Win95/98 precision is on even seconds). The 
# Time Check Precision= switch can be used to establish a +/- range, 
# inside of which two files will be considered identical if their 
# name & size are the same. Specify the value in seconds to use 
# for Time Check Precision. If not specified, Time Check Precision=3 
# is assumed.
Time Check Precision=3

 

# *** PATH 2 TIME COMPENSATION ***

# The Add Seconds To Second Dir= switch can be used compensate for a
# known, exact time difference between two paths. This switch can
# be useful if time zone differences are affecting the reported file
# times for one or the other path and if you do not wish to use
# 'Binary File Contents' compare mode (Check Same Size Files=
# switch). If Add Seconds To Second Dir= is specified the program
# adds or subtracts the specified number of seconds from the
# reported file times for Path2. 
# For example, if Add Seconds To Second Dir=3600 is specified and 
# a file time stamp is 08:00, the program will use 09:00 for the 
# file time when evaluating comparisons. The value can be + or -. 
# All files in path2 are affected. Add Seconds To Second Dir= is 
# a fixed value, not a range. Omit this switch entirely if you do 
# not need it.
# Add Seconds To Second Dir=

# *** CASE SENSITIVE NAME MATCHING ***

# Use this to compare file names case sensitive or not. If not

# specified, Case Sensitive=0 is assumed.

# Possible Values:

# 0 = File name matching not case sensitive.

# 1 = File name matching is case sensitive.

Case Sensitive=0

 

# *** GROUPING SIMILAR FILES ***

# When Group Files=1 is specified, the program clusters files in

# a comparison display by file name, with orphaned files grouped

# at the top or bottom of the list. When Group Files=0,

# comparisons are organized such that 'missing' or 'unmatched'

# files are visible within the context of other files according

# to the sort order. If not specified, Group Files=0 is assumed.

# Possible Values:

# 0 = Do not group files.

# 1 = Group files.

Group Files=0

 

# *** DISPLAY AND OUTPUT COLUMN SETTINGS ***

# The Display Columns= and Output Columns= switches can be used

# to control the layout of Directory Toolkit's GUI display and

# the layout of the output report in Directory Toolkit and Folder

# Synchronize.  The default used for a script are the settings in

# place when the program was last run interactively. Describing

# the possible manual settings is complicated.  Please see

# 'ScriptColumnDefinitionSettings.txt', that is installed in the

# program path, more information and some example settings.

# Display Columns=

# Output Columns=

 

# *** SORTING OPTIONS ***

# To sort the file listing, use one of the values below.

# To control ascending vs descending, use the Sort Type=

# switch.

# Field to sort on:

# SORT_BY_NONE = -1 (default if nothing specified)

# SORT_BY_NAME = 0

# SORT_BY_TYPE = 1

# SORT_BY_DATE = 2

# SORT_BY_SIZE = 3

# SORT_BY_PATH = 4

# SORT_BY_CHKSUM = 5

# SORT_BY_CRC32 = 6

# SORT_BY_ADATE = 7

# SORT_BY_CDATE = 8

Sort Compare=-1

 

# For Ascending vs Descending, Sort Type= values are:

# 0 = Descending

# 1 = Ascending

Sort Type=1

 

# *** FILTERING FILES ***

#

# The Mask= switch filters files by name &/or path.

#

# Other switches are available to filter files by size, date, and

# file attribute. The Reverse Filters= switch is used to cause

# these switches to function as 'exclude' or 'include'.

#

# The values at below are the defaults if not specified (all

# files included).  Omit those entirely if you do not need any

# special settings.  The switches work in tandem with each other and

# the combinations of values is very complex. Please see the file,

# 'ScriptFilterSettings.txt', that is installed with the program

# for more information.

#  
# The program has a special string - %%today%% - that can be used
# for the two date filters. %%today%% uses the current computer date
# for the respective filter setting. You can add or subtract days
# by specifying a +/- value before the ending %% characters. 
#  
# Examples: 
# %%today-5%% uses a date filter of the current date minus 5 days
# %%today+1%% adds one day to the current date
#
# Defaults: 
# Min Size Filter=0

# Max Size Filter=100000

# Min Date Filter=8/21/2003

# Max Date Filter=8/23/2003

# Skip Files Mask=0

# Ignore Attributes=55

# Reverse Filters=0

 

# *** ADDITIONAL ACTIONS ***

#

# Scripts can carry out more than one action. To do this, make

# [ActionX] as modeled below. They can be specified in any

# order in the script. The program parses the entire

# script and implements the 'Actions' sequentially, based

# on their number,

# e.g., [Action1], [Action2], [Action3], etc.

# Setting specified in [Default] will be in effect if that same

# switch is not specified in a given Action section.

 

[Action1]

Path1=D:\Test\Folder1

Path2=D:\Test\Folder2

Mask=*.*

Search_subdir=0

Operation=6

 

[Action2]

Path1=D:\Test\Folder1\SubFolder

Path2=D:\Test\Folder2\SubFolder

Mask=*.*

Search_subdir=0

Operation=1

Confirm Updates=0

 

[Action3]

Path1=C:\My Documents\Current Projects

Path2=C:\My Documents\Backup

Operation=2

Mask=*.doc;*.txt;~\*\Project10\*\*.doc

Confirm Updates=1

Search_subdir=1

 

# The next two [Action] sections use the "Alternate Specification" 
# described in the [Default] section. Note that [Action5] uses a literal
# path and a variable path that is defined in the [Default] section.
[Action4]
Path1=TestPath2
Path2=MyDocsForWork
Operation=2
Mask=*.doc
Confirm Updates=0
Search_subdir=1

[Action5]
Path1=D:\Old_Work_Stuff
Path2=MyDocsForWork
Operation=2
Mask=*.txt
Confirm Updates=0
Search_subdir=1

 


[Back] [Home]

© 1995-2024 Funduc Software. All rights reserved.
http://www.funduc.com
http://www.searchandreplace.com
Send comments to webmaster@funduc.com