ftp automation

ScriptFTP

The professional tool to automate FTP, SFTP, FTPS and schedule FTP batch jobs

The forum is now read only. Please, go to the the main ScriptFTP website if you need help.
Need help writing a script? Have any question about ScriptFTP?
Hi,
How to rename multiple folder of multiple ftp?

Thanks.
Renaming remote folders can be done with the RENAMEFILE command. To rename multiple directories at once you have to use also GETLIST and FOREACH:
FTP Script
  1. # Change current remote folder
  2. CHDIR("my_remote_filder")
  3.  
  4. # Retrieve the list of remote directories
  5. GETLIST($list,REMOTE_DIRECTORIES)
  6.  
  7. # for each one rename it adding the suffix "-processed"
  8. FOREACH $directory_name IN $list
  9.     RENAMEFILE($directory_name,$directory_name."-processed")
Thanks