This help topic documents some rare and not very commonly used ScriptFTP features. Some users may find them useful and eventually, if any become popular, they may get its own help topic.

ScriptFTP.exe command line options

The syntax of ScriptFTP.exe is the following:

ScriptFTP.exe <script_file_path> [custom parameter | /AUTOCLOSE | /HIDE ] [custom parameter]…..[custom parameter]

It’s very similar to the syntax of scriptftp_console.exe shown on this topic, but you can also use /HIDE or /AUTOCLOSE in the second parameter to change the way ScriptFTP starts or closes:

  • /AUTOCLOSE  Closes ScriptFTP automatically once the script finishes
  • /HIDE  Starts ScriptFTP as a background process. No window is shown.

 

Special characters

Added in ScriptFTP 3.1. The command CHR() can be used to get a character from its ASCII value. For example:

# It should print:
# abc
# def
$string = "abc".CHR(13)."def"
PRINT($string)

Operations with dates

Added in ScriptFTP 3.1.

# Get the current date in the format YYYY_MM_DD-hh_mm_ss
$currentdate=GETDATE(FORMAT0)
 
# Then, you can substract or add seconds to that date stored
# in the variable. Yesterday is:
$yesterday=$currentdate-(60*60*24)
# (3600*60*60) is the amount in seconds in a day.
 
# This shold print the yesterday date:
PRINT($yesterday)

Transfered files counter

Added in ScriptFTP 3.1 as GETTRANSFEREDFILESCOUNT (one R, misspelled).
Changed command name to GETTRANSFERREDFILESCOUNT (two R) in ScriptFTP 3.2.

SYNC("C:\mylocaldir","/myremotedir",UPLOAD)
IF(GETTRANSFERREDFILESCOUNT() &gt; 0)
    PRINT("Some files were transfered")
ELSE
    PRINT("No files transfered")
END IF