Script

FTP

The professional tool to automate FTP, SFTP, FTPS and Batch FTP

A dump of random common questions

18th January 2017
I would like to obtain the encryption tool.
For sending you a link of the scripting tool it is needed to buy a license. You can find more information here.
How can i start a scheduled task every hour at XX:55 and at startup of scriptFTP
You need to create a scheduled task within ScriptFTP and then open the windows task scheduler (usually under the control panel). Once you have located that task in the windows scheduler, open it and go to the “Triggers” tab. There you have to schedule the task to be run daily at, for instance, 00:55 and to be repeated every hour for one day.
To run a script file at the ScriptFTP startup you need to create a shortcut in windows that calls ScriptFTP wiith these parameters:
C:\Program Files(x86)\ScriptFTP\ScriptFTP.exe “C:\the_path\to_my_script\the_script_file.ftp”


How to download a file from the web in ScriptFTP

29th December 2016
ScriptFTP has commands to retrieve files from FTP sites only but it can also download files from the web (HTTP/HTTPS) using an external tool like CURL. You can download it going to this page. The Windows version of CURL is almost at the bottom of that page.
Once you have downloaded it you need to place curl.exe in any folder and call it from ScriptFTP using the EXEC command this way:
# Set the current local directory
LOCALCHDIR("C:\Users\Carlos\Desktop\curl_downloaded_files")
 
# Call curl
EXEC("C:\path_to\curl\curl.exe -O https://www.mydomain.com/thefile.zip")
If you browse the CURL website or run “curl.exe –help” you will notice the big amount of options and switches it has. It is a very versatile tool that not only downloads file from websites, it is also capable of automating form filling, HTTP authentication etc. For example, if the web browser prompts to enter an user name and password you can tell curl to login this way:
# Download a file using HTTP authentication
EXEC("C:\path_to\curl\curl.exe --user johndoe:thepswd -O https://www.mydomain.com/thefile.zip")
Note that HTTP authentication is not the kind of authentication you commonly find when going to web sites like yahoo mail, gmail etc. These are just HTML forms. You can identify HTTP authentication when the browser asks for the login in a very spartan pop-up window on top of the web browser.

read more …

Tags


Handling file dates and time spans

13th December 2016

The ScriptFTP scripting language does not have data types (As most scripting languages) and dealing with anything which is not plain text requires some kind of tricks. This happens with file lists as we have seen before, dates and time spans suffer the same limitation. This post covers how these data types are handled in ScriptFTP.

read more …


Lists in ScriptFTP

24th November 2016

ScriptFTP, as many script languages, does not have data types. This makes the script language and its syntax a lot easier to learn but not as powerful as others. Think of it as being “not so descriptive” and “less complex”. The drawback, in practice, is that you cannot handle things like “lists”,”sets” etc. Everything is a plain text string and you need to deal with this limitation to get the things done.

Regarding to the lists. How can the FTP script handle a list? There is a shortcut:

$my_list = "my_item_number_1|my_item_number_2|my_item_number_3"
 
FOREACH $item_name IN $my_list
     PRINT($item_name)
END FOREACH

Running the script you get:

my_item_number_1
my_item_number_2
my_item_number_3

 

read more …

Tags


How to run a scheduled FTP script in the background

16th November 2016

The ScriptFTP integrated scheduler is used to set a script to be run at given times. Once a script is scheduled the Windows Task programming service will automatically launch ScriptFTP.exe with the appropiate parameters and a window will pop-up in the user desktop and do the file transfer. Some users find this annoying and want the FTP script to be run in the background. This post covers this issue.

 

read more …


ScriptFTP 4.1

7th November 2016

This new release comes with the following changes

  • Brand new user interface that works fine under high DPI displays (mostly newer laptops and high end screens). If you see the ScriptFTP window very small or with a normal size but blurry this release will solve the issues
  • New ScriptFTP scheduler that works under the newest version of the Windows Task Programming service (Windows 8/10)
  • Faster script execution and separate process for script running
  • The status bar shows buttons to quickly access to script autorun and script output settings.
  • Updated security SSH and SSL protocols with the latest revisions.
  • Other minor bug fixes.

Tags


How ScriptFTP 4.1 looks on high-dpi screens

15th August 2016

Since the version 3, ScriptFTP has relied Windows Forms to build its buttons, panels etc. This is one of the many available tools that we the software developers use to build user interfaces, a very popular in fact. But since high density displays (high DPI displays) are becoming more and more popular, users of the apps that use this technology notice that they look bad on their shiny new screens. They only have two choices: scale everything up, making these apps look pixelated or keep their original size and struggle to understand anything on the program because every element is shown tiny, almost unreadable.

Fortunately, some time ago, Microsoft released new programmer tools to build user interfaces (WPF and XAML) that scale gracefully across different screen sizes and pixel densities. The latest version of ScriptFTP (v4.1 and still under development) has been built using these tools and looks much better on modern computers. Take a look at the difference, older version on the left, new version on the right:

 

 

If you want to try the beta version feel free to drop an email at support@scriptftp.com . Most of the things are already working except the script scheduler.


New web site

4th August 2016

It has been a long time since the last time the ScriptFTP web site has changed its looks. Except for minor updates in the Examples and Documentation section. We have finally made the conversion of all of its contents to a brand new server and a completely redesigned look.

The changes? Most of them related to the new stardards for web site development. You know, responsiveness for firendly mobile view, bigger elements for high dpi displays and so on. Now let’s focus on the next release of the program.

 

Tags


A note about the script to EXE conversion service

7th January 2015

From time to time we receive an email asking if the script to EXE conversion service (more info about it here) is an installable software, or a Windows service that runs in the background and automatically converts the FTP files to standalone EXE programs.

Well, it is not. This is a special kind of customer service where we manually build an EXE file (using the Windows development tools) from a script file you send to us. It is that simple ;).

redisschema


A question regarding how to share parameters between many script files

13th December 2014

I would like to share here a common question that from time to time it is answered via email (you can request tech support in the Contact section):

Dear Support:

Sorry to bother you, I looked at a few forum pages and could not search for ‘include’ (because it was ‘a too common word’).  Just a high-level question in three parts as I am evaluating ScriptFTP:
1) Can I use the equivalent of an ‘#include <stdio.h>’ (C notation) to put common parts of scripts or functions into one place?  All the examples I have seen were in one stand-alone ‘.ftp’ file.
2) If not possible, can I at least make a connection script that I call from another script and use it?
(For example on.ftp is the logon and off.ftp the logoff script, can I have a main.ftp that calls on.ftp, does some FTP stuff and calls off.ftp then?)
3) If 2) works, could I call the three .ftp scripts from a Powershell individually (in sequence)?  Or do I lose the connection as soon as the script is done?

So far I am impressed.  The scripting is easy and straightforward, and from what I’ve read I can combine it with Powershell via command line… The best feature is the return code check after each command during the session.  Good job.

And our answer here:

1) “Including” other script files within a script is not supported, sorry.

2) If you want to share server names, user names etc among many scripts try using GETENV (to retrieve an environment variable where you have stored the FTP server address, for example) or use GETPARAM which retrieves parameters from the command line. I hope this answer your question.

3) The connection is lost but you can call three script sequentially just call ScriptFTP.exe the_script_path.ftp. See ScriptFTP in the command line