Can "FTPcommand>" remove folders?

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
A.Enrico
Newbie
Posts: 7
Joined: Tue Nov 13, 2007 1:24 am

Can "FTPcommand>" remove folders?

Post by A.Enrico » Tue Nov 13, 2007 1:40 am

Hi members and mjtnet

I wounder if "FTPDelFile>" is the command too use if you want to
delete a folder on a remote FTP server?

Seems too me that FTPDelFile> can only remove files with exact path (no
wildcard support) But that can be arranged with a FTPGetDirList> and loop
though each files.

But how do you actually remove that particular folder?

Sincerely

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Nov 13, 2007 9:13 am

Hi,

Presently no, there is no native function to delete a directory by ftp.

You could do this though:

WriteLn>%TEMP_DIR%\ftp.txt,r,USERNAME
WriteLn>%TEMP_DIR%\ftp.txt,r,PASSWORD
WriteLn>%TEMP_DIR%\ftp.txt,r,rmdir /path/folder
WriteLn>%TEMP_DIR%\ftp.txt,r,quit

Let>RP_WAIT=1
//uncomment to run hidden
//Let>RP_WINDOWMODE=0
Run>ftp.exe -s:%TEMP_DIR%\ftp.txt ftp.server.com

DeleteFile>%TEMP_DIR%\ftp.txt
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

A.Enrico
Newbie
Posts: 7
Joined: Tue Nov 13, 2007 1:24 am

Post by A.Enrico » Tue Nov 13, 2007 12:02 pm

Nice workaround, Thanks!

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts