- GETTING STARTED
- GUIDES
- COMMANDS
- Server connection
- File Transfer
- Directory operations
- File operations
- Script output
- Miscellaneous
- OTHER
Advanced topics and rare features
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 | /TRAY] [custom parameter].....[custom parameter]
It's very similar to the syntax of scriptftp_console.exe shown on this topic, but you can also use /TRAY, /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.
- /TRAY Starts ScriptFTP as a tray icon.
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 AAAA_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()>0)
PRINT("Some files were transfered")
ELSE
PRINT("No files transfered")
END IF
Stop file logging
# This script logs only the download process
# it used the STOPLOG command to stop any
# further logging
OPENHOST("ftp.myhost.com","myuser","123456")
LOGTO("MyDownloadlog.txt")
GETFILE("*.*")
STOPLOG()
CLOSEHOST

