I cannot find anything in
NSFTOOLS: List of FTP commands for the Microsoft command-line FTP client[
^] which allows to determine whether a folder's element is a folder or a file. I do not think you will be able to achieve your goal by using purely the script facility of genuine Windows ftp client.
You could develop an application to handle the logic, though. There are ftp client libraries for all major languages and technologies.
Kindly.