Folder Synchronize Command Script File Syntax
Version 3.0
Funduc Software, Inc
Copyright 1997-2023
http://www.funduc.com    http://www.searchandreplace.com
support@funduc.com      

Listed below are the switches and settings available for Folder Synchronize. We present this information in the form of a commented script. Scripts are ASCII text files (PC format). You can create them manually with your text editor or use our freeware Folder Synchronize Script Editor

A text version of the script syntax is included with the distribution of Folder Synchronize in the file, "FoldSynchSyntax.sfs". 

Some abbreviated sample scripts with commented descriptive information and a test path with some dummy files is included in the 'SampleScripts.zip' file in the distribution..

Scripts are submitted to the program from the command line. Folder Synchronize does not have a user interface. Scripts are submitted to the program from the command line. The basic syntax is 

   FOLDSYNC.EXE <script file name>

Please see the program documentation for more information about command line syntax.


# 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 within [Action] section(s). Any parameters

# that are present within an [Action] section override counterparts

# in [Default].

#

# All scripts must have at least one [Action] section!!

#

# For a single action script you can specify a [Default] if you

# want but [Action1] MUST be present. In practice, for single action

# scripts you may find it easiest to omit [Default] entirely and

# specify all parameters under [Action1].

#

# When present, [Default] should always be specified at the very top

# of the script.

#

# The order of processing for the [Action] sections is determined by

# their number. They can be placed in any order within the script.

# Numbers do not need to be inclusive -- you can skip numbers.

# For example, a with [Action8] [Action2] [Action5] will be processed

# in the order: [Action2] [Action5] [Action8].

#

# 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

 

# 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 [Action4] and [Action5] sections below, and the

# Example4.sfs sample script for more info.

 

# *** 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 *.*

# If you have Directory Toolkit, 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 Search_subdir= switch to include subdirectories or not.

# The default if not specified is to search and process all

# subdirectories.

# Possible Values:

# 0 = Do not recurse subdirs

# 1 = Include subdirs

Search_subdir=1

 

# *** SYNCHRONIZE/COMPARE OPERATION TO PERFORM ***

# Use the Operation= switch to control which synchronize

# operation to perform. If not specified, Default Operation = 6.

# Use only one switch per [Action] section. Use a value of 6

# (Compare Only) to generate an output report without performing

# any synchronize operations.

 

# The - value, 'prompted' switches below trigger a synchronize

# dialog that waits for user input.

 

# Note: Please see Prune Notes for info about the behavior of

# Operation=4 when no files are updated and/or no orphan files

# are to be removed.

 

# 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.

# Custom Operation 9 -11 Custom synch operations using the

# Synch Flags= switch. See below!!

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

Operation=6

 

# *** CUSTOM SYNCH SWITCH ***

# This is a special switch for version 2.7+ that permits finer

# control over the synch operation(s) to be performed. It is

# used in combination with the Operation=9 or -11 switch values

# to do one or more types of operation(s).

#

# If Operation=-11 is specified, the Synchronize dialog is

# presented with "Custom" and your setting for Synch Flags= pre-

# selected. If Operation=9 you MUST specify something for

# Synch Flags= or the program will do nothing.

#

# The table of values below is used to determine which are done.

# You can use only one operation by specifying that one value or

# do multiple choices by adding the values together. For

# example, to only add new files to the target path, specify

# Operation=9 and Synch Flags=32. To add new files to the target

# and delete empty dirs on the target, specify Operation=9 &

# Synch Flags=288. (Note: For 'Prompted' use Operation=-11).

#

# Possible Values for Synch Flags= Switch:

# Remove Orphans From Source = 1

# Update Existing On Source = 2

# Add New Files To Source = 4

# Remove Orphans From Target = 8

# Update Existing On Target = 16

# Add New Files To Target = 32

# Delete Duplicates From Target = 64

# Create Subdirs On Target = 128

# Delete Empty Dirs On Target = 256

#

# The order of precedence of operations is:

# Delete files from target; Delete files from source

# Delete duplicates from target; Update source|target

# Add new to target; Add new to source

# Create dirs on target; Delete empty dirs on target

#

# Why is the precedence relevant? First, delete operations may

# eliminate chances for a lower precedence operation, e.g., delete

# files from source might mean that a create subdirs on target can't

# happen because the original file(s)/subdir(s) would be eliminated.

# Second, if confirmations are enabled and Cancel is issued for any

# of the deletes, all other possibilities are also canceled. Second,

# if a higher precedence step cannot be completed, or is canceled

# manually, lower precedence step(s) are not performed.

#

# Synch Flags=2

 

# *** OUTPUT FILE FUNCTIONS ***

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

# name using the Output File= switch. Leave Output File= blank

# to not write an output file. To write to the output file in

# Append mode, use the Append to Output File=1 setting.

# It is OK to define different Output File= and

# Append to Output File= settings for various [Action] section(s).

#

# 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

 

# *** PREVIEW YOUR OPERATIONS ***

# The Destination Path= switch, if specified, is the path to copy the

# file(s) to instead of the Path2= path. For example, if your

# synchronize choice determines that letter.doc would be copied from

# the Source to the Target, if a path is specified in Destination= ,

# letter.doc would be copied there instead.

# Destination Path=c:\tools\foldsync\test_results

 

# *** PROGRESS METER ***

# The progress meter can be enabled/disabled with this switch.

# The default if nothing is specified is to display the meter.

# If the script has multiple [Action] sections, you can enable

# the meter for some [Action]'s but not others by using

# different settings in each [Action]. Or you can specify one

# setting in the [Default] section and different Show Progress=

# setting(s) in specific [Action] sections.

#

# To make the program run silently, disable confirmations and

# the progress meter. Example:

# Confirm Updates=0

# Show Progress=0

#

# Possible Values:

# 0 = No meter

# 1 = Progress meter enabled

Show Progress=1

 

# *** DISABLE/ENABLE CANCEL BUTTON ***

# The progress meter includes a Cancel button. The default if

# nothing is specified is to allow cancel. If the script contains

# multiple [Action ] sections, depending on the point at which the

# cancel button is clicked, the user is prompted to cancel

# the current [Action] or the entire script.

#

# If Show Progress=1 is not specified Allow Cancel= has no effect.

# You can vary Allow Cancel= across specific [Action] section(s)

# to allow cancel at some points but not others. If you do this

# you should put 'no-cancel' [Action]'s at the top of the script

# so the user cannot use cancel to abort the entire script.

#

# Note: Allow Cancel= only affects the Cancel button in the

# progress meter. If you enable file change confirmations with the

# Confirm Updates=1 switch a separate Cancel button is presented

# in that dialog. See Cancel Prompts for more information.

#

# Possible Values:

# 0 = Disable Cancel button

# 1 = Enable Cancel button

Allow Cancel=1

 

# *** DISPLAY CUSTOM BITMAP ***

# The program can display a bitmap (transparent) in the progress

# meter. The bottom left pixel of the .bmp is used as the transparent

# color. The suggested size for the .bmp is 195 x 65 pixels.

# Similar to how the progress meter can be enabled for some [Action]'s

# and not others, a different .bmp can be specified for various

# [Action ]'s. The Show Progress=1 switch must also be specified for

# Bitmap File= to have any effect.

# Bitmap File=D:\Scripts\Test1.bmp

 

# *** MESSAGE TO DISPLAY ***

# To display single line message in the progress meter, use the

# Custom Message= switch. Similar to how the progress meter can be

# enabled for some [Action]'s and not others, Custom Message=

# settings can be varied across [Action ]'s. Show Progress=1 must

# also be specified for Custom Message= to have any effect.

# Custom Message=Performing a synchronize....

 

# *** DISPLAY ERROR MESSAGES ***

# Use the Display Error Messages= switch to control whether or

# not the program issues small 'Action Completed' message

# boxes after a script is complete. We recommend using

# 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

 

# *** REPLACEMENT CONFIRMATIONS ***

# Controls whether prompting for file replaces and deletions is made.

# The Use OS Operations=1 switch determines the style of the

# prompting offered. If not specified, Default = 1.

# Possible Values:

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

# 1 = Confirmation prompts will be made.

Confirm Updates=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, Default = 0.

# 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 in place. Default = 1.

# 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, Default = 1.

# Possible Values:

# 0 = Do not include those files

# 1 = Include those files

Show Different=1

Show Identical=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

# other two different paths can be scanned as well. 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 is the most common usage.

# 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 XP & above

# 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.

# Specify the value in seconds to use for Time Check Precision.

# If not specified, Default = 3.

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 a file time stamp is 08:00 and Add Seconds To

# Second Dir= 3600 is specified, 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=

 

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

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

# confirmation dialog used: internal file 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. If not specified, Default = 1.

# Possible Values:

# 0 = Use internal file confirmation dialogs.

# 1 = Use native OS file operations.

Use OS Operations=0

 

# *** 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, the default = 1.

# 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

 

# *** CASE SENSITIVE NAME MATCHING ***

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

# specified, Default = 0.

# Possible Values:

# 0 = File name matching not case sensitive.

# 1 = File name matching is case sensitive.

Case Sensitive=0

 

# *** 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.

# Possible Values:

# 0 = Do not overwrite.

# 1 = Allow overwrites.

Newer Overwrite=0

Older Overwrite=1

 

# *** 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, Default = 0.

# 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 can be complex. Please see

# Please see Date and Size Filters in the program documentation

# for more information. Also see the 'ScriptFilterSettings.txt'

# file that is installed with the program.

#

# Also note that you can use the string, %%today%%, for the two

# date filters. When specified, %%today%% automatically uses the

# current computer date for the respective filter setting. You can

# add or subtract days by specifying a +/- value before the ending

# %%. Examples: %%today-5%% uses a date filter of the current date

# minus 5 days; %%today+1%% adds one day to the current date.

#

# Min Size Filter=0

# Max Size Filter=100000

# Min Date Filter=8/21/2003

# Max Date Filter=8/23/2004

#

# 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