Looking for FTP client that will read Delete or Move commands from a file

I have 25,000 files to remove from a remote server.

I need to specify the files individually, since the deletion criteria is not determined by the date or file type.

My hosting company will not let me run batch files on their server, so ftp -s: will not work.

I've tried Total Commander. It has a download copy from list feature, but no move or delete feature.

I've tried Robocopy and smartFTP but neither seems to be able to read from a list.

Does anyone know of an FTP client that will read delete or move commands from a file?

Many thanks,

Who is Participating?
Globalscape Cute FTP Pro, beleive it or not
Pete LongTechnical ConsultantCommented:
>>Does anyone know of an FTP client that will read delete or move commands from a file?

I do not :(

However heres a different approach

On the FTP server set up Telnet access to the FTP folder - Most Good Telnet/Terminal Emulators can send a LOT of commands straight from a text file (this is how we network types send big configs to firewalls/routers etc)

just a thought :)
Unfortunatly there are no freeware that deals with all your requests. I know that LeapFTP is able to fulfill your deamands. Read about it, try it and if youl like it; buy it... it is a great software and is very cheap:

Enjoy (moving 25,000 files is not that enjoyable but...)

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Great idea PeteLong

You should try this approach as well...

Pete LongTechnical ConsultantCommented:
ooh I use LeapFTP hang on I'll take a look
Pete LongTechnical ConsultantCommented:
from the LeapFTP help

Scripting Language

The scripting language allows you to created completely automated transfer processes.  It supports all of the implemented FTP commands, and supports wildcard file arguments.  

Making a Script File

Use the following guidelines when making a script file:

1.  Files are in DOS text file format
2.  Put each command on a separate line
3.  Commands must be in the proper syntax.  See script commands.
4.  The last line in the script file must be ‘END’.

Script commands are in the form:
Command({-Local | Remote}):<arguments>


<>  Required argument
[]    Optional arguments
  |    Requires one of the two options (ex: CD-L or CD-R)
( )   Required on commands with {|}

Basic Commands:

Set the transfer mode to ASCII.

Set the transfer mode to auto-detect.

Set the transfer mode to Binary (Image).

CONNECT:<Server name or site name>[:user:pass:port]
Connects you to the specified FTP server.

Disconnect you from the FTP server.

Minimize LeapFTP in the system tray.

Sends the given command to the server.

Restore LeapFTP to its last position.

Close LeapFTP, stopping the current operation

Directory Commands:

CD-L | R:<path>

Change the current working directory.

RD-L | R:<path>
Remove the given directory.

MD-L | R:<path>
Create the given directory.

File Commands:

CHMOD:<access mask>:<file | wildcard mask>
Change the file access mask for the given file(s).

DEL-L  | R:<file | wildcard mask >
Delete the specified file(s).

FILTER-L | R:<mask>
Sets a filter mask so that only files that match the given mask are visible.

GET: <file | wildcard mask >
Download file(s) to your computer.

PUT: <file | wildcard mask >
Upload file(s) to the remote server.

PUTDEL: <file | wildcard mask >
Upload file(s), and delete the local copy if successful.

QUEUE-L | R:<file | wildcard mask >
Add file(s) to the transfer queue.

RENAME-L | R:<source>:<target>
Renames a file.  You can also use this to move a file by specifying a full path and filename for the <target>.

Transfer all files in the queue.

Advanced Commands:

Pauses for the given number of seconds before executing the next command.

DIAL: <entry name>
Dials the specified Dial-up networking entry

Disconnect the active Dial-up networking connection

IFEXIST-L | R:<file | wildcard mask > | ENDIF
Executes the block of code between IFEXIST and ENDIF if one or more files matching the given mask are found in the current directory.

LOOP:<count> | ENDLOOP
Executes a block of code multiple times.  Place the ENDLOOP after the last command in the block to be repeated.  Setting a loop count of 0 will create an infinite loop.  You can not have a loop within a loop.  

Sends the specified command directly to the server

Run the specified program.  You must provide the fully qualified filename to an executable file.

DDE Commands: The following commands only work when you have an active DDE client link.

Terminate the current operation.

Close the DDE link.

Open the DDE link.

Show the files in the current directory.

Show the current path.

SCRIPT:<script name>
Run the script.

Show the current transfer status.
You could use UltraFXP 1.7 Free Edition, which isn't anymore available at developer's homepage, and can be hard to find, you can try your luck with "ultrafxp.exe 1.7" etc words. But - I have made the 1.7 version available with YouSendIt.com service, download the file here: http://www.yousendit.com/d.aspx?id=F7C1F4A254A74AA9DDDBEB477CF1A3A5
In case the service is not working, reply here and I will put it to more reliable place.

Your choices for deleting files:

If you have your files to be deleted in .txt or another file AND you have Excel and some good text-editor available (EditPlus), this is easy.
After installing UltraFXP, go to Commands / Edit Command menu
Press the "New Command" button
Click "Run as script" checkbox
Open Excel
Put to A1: uf_raw('','DELE
Put to A2: List of your files to be deleted as a list
Put to A3: ');
If your list had 100 entries, "stretch" your A1 and A3 columns so they are equal with A2.
So now your list should be looking like this:
1 uf_raw('','DELE file1.txt');
2 uf_raw('','file2.txtt');
3 uf_raw('',file3.txt');

Then copy all your Excel contents to your clipboard, and since Excel puts space to it, you need to paste them to a texteditor. So after you've pasted your clipboard content to a texteditor (EditPlus), choose the space/tab area, not the one space! Then choose Search / Replace.. or press CTRL+H. In Search&Replace Window, you see the empty space as square. Leave "Replace with:" empty and click Replace All.
Now you have all your empty spaces removed and you can go on and paste your list to UltraFXP.
Then just press "Run" in UltraFXP and you have removed all the files you have specified.


You can use the Tools / Find Files at FTP Server -command, where you can:
Use wildcards, so *cat* would catch the files: mouse&cat.mpg, cat.exe, folderlist.cat, etc.
Setup date filters, for example search files between june - july.
File size, find files at least X bytes, or at most X bytes.
You can specify how "deep" the UltraFXP will search, so you can find your files no matter which directory they are.
I'd like to add in case you don't have Excel or other tools available, you can send the file where you have list of files to be deleted to me and I can create ready list, which you can paste to UltraFXP command-menu and run.
tomfolinsbeeAuthor Commented:
Thank you everyone for your excellent suggestions. I've been busy trying them out over the past few days.

Pete&Cyber-dude, I looked at leapFTP but found it difficult to get my head around the scripting language (i'm not a programmer!), so I started to look at some of the other suggestions.

Jannepm, I download the file, but I'm afraid that I can't find the "New Command" button. I checked each button and went through each menu and the help file.

Chucks10, I downloaded cuteFTP and the sample script provided seemed easy to follow so I tried to modify it for my site. I'm making progress, but I'm still getting an error.

Just to recap - the file names look like this: 1234567.txt. They are stored in a folder called /Storage with two subfolders. The first subfolder is = left(filename,2) and the second is mid(filename,3,2). So, filename 1234567.txt is stored in /storage/12/34/1234567.txt

Here is the modified sample script that is still causing a "remote folder not found" error.

'This default template script is in VBScript. You can write scripts in your language of choice and save them with the proper extension, or use your an editor specific to that language.

'See the TESDK help file for more details on how the scripting feature works and for information on each supported method and property.

'You must have Windows Scripting Host installed for the COM enabled engine to work. Run the Transfer Engine once to register it (as a COM object) on the target system.

'If you're having problems with running scripts while not logged in, or when trying to run them using MS scheduler, refer to our online knowledgebase for help (http://www.globalscape.com/support)

'Look into c:\temp folder to observe local activity (for testing purposes) or right click on the Transfer Engine icon in the systray and select "show current transfers"

'This sample script performs an anonymous login to ftp://ftp.globalscape.net

   'First declare a variable called Mysite. This will hold the reference to the TE COM object.

   Dim MySite

   'Create a connection object and assign it to the variable

   Set MySite = CreateObject("CuteFTPPro.TEConnection")
   ' Now set each property for the site connection
   ' You can omit this section to use the default values, but you should at least specify the Host
   'The default Protocol is FTP, however SFTP (SSH2), FTPS (SSL), HTTP, and HTTPS can also be used)

   MySite.Protocol = "FTP"
   MySite.Host = "www.mysite.com"

   'following lines are optional since the default is anonymous if no login and password are defined

   MySite.Login = "mylogin"
   MySite.Password = "mypassword"

   'if necessary, use the UseProxy method and ProxyInfo or SocksInfo properties to connect through a proxy server

   MySite.UseProxy = "BOTH"

   'now connect to the site (also called called implicitly when most remote methods are called)


   'perform some logic to verify that the connection was made successfully

   If (Not Cbool(MySite.IsConnected)) Then      
      MsgBox "Could not connect to: " & MySite.Host & "!"
   End If

   ' Code to read file name and upload to a particular directory
   dim strfilename
   Dim FileSysObj
   Dim strTxtFile
   Dim IfMemTxtFile

   Const ForReading = 1

   ' set the filename which contains the list of filenames
   IfMemTxtFile = "filelist.txt"

   set FileSysObj = CreateObject("Scripting.FileSystemObject")
   set strTxtFile = FileSysObj.OpenTextFile(IfMemTxtFile, ForReading, TristateFalse)

   Do While strTxtFile.AtEndOfline <> True

     filename = strTxtFile.Readline
     msgbox filename

       ' set the root directory of your website
       mysite.remotefolder = "storage"
     b = MySite.RemoteExists("storage")

     ' retrieve the first two directory ( eg. file name 1234567.pdf)
       mysite.remotefolder = left(filename,2) ' this changes the folder to 12
     mysite.remotefolder = mid(filename,3,2) ' this changes the folder to 12\34  

   If (Not CBool(b)) Then
      'Verify existence of remote folder
      MsgBox "Remote folder not found!. Please make sure that the Pub folder exists on the remote site"
   End If

' Delete the file
   MySite.remoteremove filename



   'Complete.  Show the status of this transfer.
   MsgBox "Task done, final status is '" + MySite.Status + "'"


'End of sample script. You can save you script and then run it by either selecting it from the Tools > Run Script menu or by double clicking on the script file in Windows

Can anyone spot the rookie error?


tomfolinsbee, while you are in the UltraFXP. You see menus: Container, FTP, Queue, Options, Command, Tools, View and Help.

Choose the "Command" menu, click on "Edit Command".

Now you see the "New Command" button bottom of the screen.
jannepm  is correct
tomfolinsbeeAuthor Commented:
Thanks everyone for all your help.

I ended up using CuteFTP Pro, mainly because it had a good sample script to get me started. I still struggled with it for quite a while (I'm not a programmer!) but with a bit of offline assistance, I got it to work. Made it just in time to avoid those nasty monthly space surcharges too!

Pete LongTechnical ConsultantCommented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.