Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Remove selected files from server using a list

Posted on 2004-08-28
Medium Priority
Last Modified: 2010-04-03
I have a list of files that I would live to remove from a server. Due to the large number of files and  folders, it isn't practical to select them individually.

I've successfully used the "download from list" feature in Total Commander, however this product apparently doesn't enable you to delete files from a list. My main objective is to save on storage costs so I'm still looking for a solution.

I've also looked at smartFTP but I don't think it has this functionality.

I've also tried to use the Window command prompt, but when after I enter my user name, it prompts me for my password, but it won't let me enter anything.  Assuming I can resolve the password issue, what is the command to delete files listted in text file?

Question by:tomfolinsbee
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
LVL 57

Accepted Solution

Pete Long earned 200 total points
ID: 11920612
are you trying to delete files via FTP?

the standard FTP commands are

!                delete          literal         prompt          send
?                debug           ls              put             status
append           dir             mdelete         pwd             trace
ascii            disconnect      mdir            quit            type
bell             get             mget            quote           user
binary           glob            mkdir           recv            verbose
bye              hash            mls             remotehelp
cd               help            mput            rename
close            lcd             open            rmdir

Assisted Solution

b0bmaster earned 1000 total points
ID: 11921927

you can do it using a FTP script file, Open notepad and type in (replace as nessary)

    open  ftp.youraddress.com
    delete file1.abc
    delete file2.abc
    delete file3.abc
    delete file4.abc
    delete file5.abc

Save the file as "batch.scr"
now in command prompt type in  ftp -s:batch.scr

LVL 15

Expert Comment

ID: 11922165
AHH yes.. I had a 400 GB drive with a bunch of files that i needed to archive, by date. There is an awesome utility for this. Make sure u read the faq so you can get the commands u need.
Here is the download

here is the how to

Let me know how it goes
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!


Author Comment

ID: 11924872
plimpias, I downloaded and unzipped a copy of robocopy. When I clicked on the exe file, my screen flashed but there were no prompt or added items in my task bar.


here the script I'm trying to run:

OPEN ftp.myaddress.com
USER xxxxx
PASS xxxxx
delete /root/html/xxxx/03/82/0382752.pdf

I'm getting a 331 error Password required for delete

I'm successfully downloading files using Total Commander using this format:
ftp://myUserID@ftp.myaddress.com/root/html/xxxx/aa/bb/0002006.pdf -> C:\Data\Archive20040821\aa\bb\03/82/0382752.pdf.  

1) Could you show me a script that includes login details and that will handle multiple folders?
2) Could you show me a script that will move the files, so I don't have to copy and then delete?

Thanks for your help!

LVL 15

Assisted Solution

plimpias earned 800 total points
ID: 11925863
Robocopy will need to be ran from DOS. Goto start > Run > type CMD and hit enter

You will need to navigate to the folder in which robocopy is placed. If you placed it in a folder called COPY then type in CD C:\COPY > ENTER > then type in ROBOCOPY /? this will give u all of the things u can do. You can move by date if was last modified, BY folder name, or by file name, you can tell it if the folder in which the file is empty, remove it or leave it. This is the tool you are looking for. Im sure of it. i was in the same shoes you were in.

Author Comment

ID: 11927388
Plimpias, thanks for the additional info.   I'm not using dates or file types to select which files to delete/move. I've got a list generated by other criteria and all the file names and folders are stored in a text file. Can robocopy read a list of files stored in a text file? I've looked at the help and it doesn't look like it.

Any idea what I might be doing wrong with that windows ftp command script above?


Expert Comment

ID: 11933951

Sorry for slow reply, your script is OK sort of....

There is no PASS command. USER command syntax is like this:
     USER Name Password

Try and use your script like this - note no USER or PASS command.

   OPEN ftp.myaddress.com
   xxxxx  < Username
   xxxxx  < passoword
   delete /root/html/xxxx/03/82/0382752.pdf

If you still have problems try running FTP with -n commandline:
    c:\> FTP -n -s:script.scr

Good Luck

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is an update and follow-up of my previous article:   Storage 101: common concepts in the IT enterprise storage This time, I expand on more frequently used storage concepts.
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
This video teaches viewers how to encrypt an external drive that requires a password to read and edit the drive. All tasks are done in Disk Utility. Plug in the external drive you wish to encrypt: Make sure all previous data on the drive has been …
This tutorial will walk an individual through the process of installing the necessary services and then configuring a Windows Server 2012 system as an iSCSI target. To install the necessary roles, go to Server Manager, and select Add Roles and Featu…
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question