Fastlynx Advanced Scripting Commands
Fastlynx Advanced File Based Scripts
FastLynx 3.3 introduces a more advanced type of script that is stored in a text file with a ".fxs" extension. This new type of script offers more power and flexibility, but it is recommended only for advanced users with some technical skill. The only way to execute this type of script in FastLynx is by passing the name of the ".fxs" file as a command line argument. For example, if you created a script file call "MyScript.fxs" in the FastLynx installation folder (usually “C:\Program Files\FastLynx“), you could invoke it from a Command Prompt or a batch (.bat) file as follows:
"C:\Program Files\FastLynx\FxNt.exe" MyScript.fxs
If running the above example on Windows 95, 98, or ME, substitute "Fx.exe" for "FxNt.exe". If no path name is specified for the .fxs file, FastLynx looks in the FastLynx installation folder. You can place .fxs script files in any folder as long as you specify their full path name when passing the name to FastLynx as a command line argument. Example:
“C:\Program Files\FastLynx\FxNt.exe“ C:\MyFolder\MyScript.fxs
The ".fxs" text file can be either an ASCII text file or a Unicode text file. Following are the commands that are recognized.
connect <port name 1> … <port name 6>
Up to 6 port name parameters can be specified as arguments to this command. Each will be tried in succession until a successful connection is made. If no connection is made, the script fails.
For parallel ports, a port name of LPT1, LPT2, or LPT3 may be specified, optionally followed by a colon (‘:’) and a number from 0 to 4 that indicates the maximum parallel speed. 0 means 8-bit accelerated mode, 1 is 4-bit turbo, and so on down to 4 for 4-bit slow. Example:
which say to connect on LPT1 with a maximum speed of 4-bit turbo. If no speed argument is specified, a maximum speed of 8-bit accelerated is assumed.
For serial ports, the COM port name is specified, optionally followed by a colon (‘:’) and three comma separated arguments: the maximum baud rate, maximum block size, and a 1 or 0 indicating whether serial accelerated mode is enabled. The following example says to connect to COM2 with a maximum baud rate of 57600, maximum block size of 1024, and accelerated mode disabled:
To connect via USB bridge cable, use:
To connect to the local computer for disk-to-disk transfers, use:
To connect for TCP/IP transfers, use "connect <ip address>", or "connect <ip address>:<port>" if the FastLynx server is listening on a port other then the default FastLynx port (2689). For example:
To connect for named pipe transfer, use the full path name of the listening pipe: connect \\
The next command in the script after connect should be either send or recv.
send <local source drive/directory> <remote destination drive/directory>
The send command is followed by two arguments: the source drive/directory name on the local drive and the destination drive/directory name on the remote computer. This command indicates that files will be "sent" from the local computer to the remote computer. Additional commands are necessary to actually begin the transfer. This command simply indicates what the starting directories will be and the direction of the transfer. Path names with embedded spaces may be used if enclosed in double quotes. Example:
send “C:\Local Source Dir“ C:\RemoteTargetDir
recv <local destination drive/directory> <remote source drive/directory>
The recv command is followed by two arguments: the destination drive/directory name on the local drive and the source drive/directory name on the remote computer. This command indicates that files will be "received" from the remote computer to the local computer. Additional command are necessary to actually begin the transfer. This command simply indicates what the starting directories will be and the direction of the transfer. Path names with embedded spaces may be used if enclosed in double quotes. Example:
recv C:\LocalTargetDir “C:\Remote Source Dir“
select <file/directory name 1> <file/directory name 2> …
The select command indicates what files or directories are "selected" to transfer. Unless full path names are used (which is not normally done), the path names specified are relative to the starting directories specified in the send or recv commands. The line length for ".fxs" scripts is limited to about 4096 characters. If more file names need to be specified than can fit in one select command, multiple select statements may be used. Wildcards may also be used in specifying selected files. Path names with embedded spaces may be used if enclosed in double quotes. Example:
select fileName1 “file name 2“ fileName3 dirName1 *.dat
exclude <file name 1> <file name 2> …
If the select command includes directory names or uses wildcards, certain matching file names may be excluded from the transfer with this command. Only root file names may be specified (i.e. without any directory prefixes). The line length for ".fxs" scripts is limited to about 4096 characters. If more file names need to be specified than can fit in one exclude command, multiple exclude statements may be used. Wildcards may also be used. Path names with embedded spaces may be used if enclosed in double quotes. Example:
exclude myFile “my file 2“ *.bak
This command begins the file transfer. It must be preceded at least by a connect, send or recv, and a select command. Files are transferred to the destination, leaving the source files intact.
This command begins the file move. It must be preceded at least by a connect, send or recv, and a select command. Files are transferred to the destination, and then deleted from the source. Use this command with caution. When in doubt, use the copy command instead and delete any desired source files manually.
prompt <prompt type> <prompt setting>
This command sets the prompt settings for the script. The default setting if no prompt command is used is to prompt for every situation.
Following are the allowed values for
DirBothExist - a directory was encountered that exists on both the source and destination
DirSrcOrphan - a directory was encountered that exists only on the source
DirDstOrphan - a directory was encountered that exists only on the destination
FileTimeEqual - a file was encountered that had the same modification date and size on both sides
FileSizeMismatch - a file was encountered that had the same date but different sizes on each side
FileNewer - a file was encountered that had a newer modification date on the the source
FileOlder - a file was encountered that had an older modification date on the the source
FileSrcOrphan - a file was encountered that exists only on the source
FileDstOrphan - a file was encountered that exists only on the destination
OnError - an error occurred reading or writing the file or directory
FileOverwriteSpecial - the transfer would overwrite a file with system, hidden, or read-only attributes
Following are the allowed values for
Prompt - when the situation is encountered, prompt the user what to do
Transfer - when the situation is encountered, transfer the file or directory
Skip - when the situation is encountered, skip the file or directory
Delete - when the situation is encountered, delete the orphaned destination file or directory
Cancel - when the situation is encountered, cancel the transfer session
DirBothExist - Prompt, Transfer, and Skip
DirSrcOrphan - Prompt, Transfer, and Skip
DirDstOrphan - Prompt, Skip, and Delete
FileTimeEqual - Prompt, Transfer, and Skip
FileSizeMismatch - Prompt, Transfer, and Skip
FileNewer - Prompt, Transfer, and Skip
FileOlder - Prompt, Transfer, and Skip
FileSrcOrphan - Prompt, Transfer, and Skip
FileDstOrphan - Prompt, Skip, and Delete
OnError - Prompt, Skip, and Cancel
FileOverwriteSpecial - Prompt, Transfer, and Skip
Here is an example that transfers all folders and sub-folders, but only files that are newer:
prompt DirBothExist Transfer
prompt DirSrcOrphan Transfer
prompt DirDstOrphan Skip
prompt FileNewer Transfer
prompt FileTimeEqual Skip
prompt FileOlder Skip
prompt FileSizeMismatch Transfer
prompt FileSrcOrphan Transfer
prompt FileDstOrphan Skip
This command filters files that are transferred according to a starting and ending modification date/time. The date must contain at least the month (spelled out in English), the year (4 digits are required), and the day of month (between 1 and 31). Optionally it may also include the time of day: hh:mm:ss.mmm,
Where hh is hours (military time), mm is minutes, ss is seconds, and mmm is milliseconds. The time is optional, as are each of its components (i.e. if you specify hh:mm only, ss and mmm are assumed to be zero). Example:
daterange 3 March 2003 14:00 - 4 March 2003 15:00
This command allows you to execute a program or operating system command on the remote computer. This can be useful if you want to have the remote system perform some operation on a file that is being transferred by the script. Example:
do C:\UseFile.exe someFile.dat
The above example illustrates executing a remote program named "C:\UseFile.exe" and passing a command line argument of "someFile.dat" to it. The entire command line beyond “do“, including any embedded spaces, is passed to the remote computer.
This command causes the remote FastLynx program to exit.
This command allows you to display a message to the user running the script. The message will be displayed in a message box titled “FastLynx Script Message”. After reading the message, the user will have two options: pressing OK to continue the script, or Cancel to cancel script execution. The message must be entered on a single line, but new line characters may be embedded with the two character sequence “\n”. Tabs may be embedded with “\t”. Example:
message Before proceeding with this script, please run the GenData application.
The above example pauses script execution to instruct the user to run a particular program before proceeding with the remainder of the script. In this example, the application might generate some data to be transferred by the remaining portion of the script.