How to delete all the sub-directories in a directory

12th August 2018

Recently we received a question from a customer that was using a set of IP cameras and a central FTP server where the cameras stored their recorded videos. As the cameras generate a lot of data they wanted to schedule an FTP script that deletes all the sub-folders of a given folder.


The script is pretty straightforward, all it is needed is to use GETLIST to retrieve the list of sub-directories, then use FOREACH and RMDIR to delete each one:


read more …