Writing a basic script

You can use most common programming and scripting languages (Java, VB Script, etc.) for communicating with the Transfer Engine.  With the exception of some special function calls, the TE will execute your script in a synchronous manner, meaning all steps are executed sequentially.

 

Creating and running scripts for non-programmers

Make sure the TE has been registered and that all requirements are met.

  1. Open Microsfoft’s Notepad, GlobalSCAPE’s CuteHTML, or from the CuteFTP Professional interface, select Tools > Macros & Scripting > New.

  2. Copy and paste the code you need from the examples included in this Help file.

  3. Refer to Microsoft’s online documentation for help with the particular language syntax (msdn.microsoft.com) you are using.

  4. Save the finished file with the extension corresponding to the language you wrote the script in. Visual Basic Scripting (.vbs) is the default used in the sample code.

  5. Execute the script by double clicking it. If you receive an error, refer to the line number displayed by the error message to track down the cause. Refer to the Troubleshooting section for more help.

 

Scripts for beginners

If you have absolutely no programming experience but still want to use the Transfer Engine for some previously recorded macros created in earlier versions of CuteFTP, you can still run these macros from within the CuteFTP interface.

  1. Go to Tools > Macros & Scripting > Run.

  2. Locate and click your previously recorded macro. The macro will run. You should also be able to execute it by simply double-clicking on the particular macro file on your system, if CuteFTP Professional has been previously associated with .mcr files.

 

Creating and running scripts for programmers

  1. Create a new script file using your favorite IDE.

  2. Use the included examples to get started if necessary or refer to the reference section of this document to learn the methods and properties supported.

  3. Save the file with the appropriate extension (.js, .vbs, etc.).

  4. Execute the file from the command line or as a scheduled event.

 

Running a script from the command line

  1. Locate the path for the CuteFTP Professional Transfer Engine.

  2. From a command prompt, type:

[path_to_TE]\ftpte.exe /Script [scriptname].[ext]

 

 

Note

The TE runs as a process, not a service, therefore you must be logged in to execute scripts.