Remove selected files from server using a list

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?

Thanks!
tomfolinsbeeAsked:
Who is Participating?
 
Pete LongConnect With a Mentor Technical ConsultantCommented:
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
0
 
b0bmasterConnect With a Mentor Commented:
Hi,

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
    close
    quit

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


0
 
plimpiasCommented:
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
http://www.asia-links.com/biz/download/product.asp?productid=74&folderid=77&parentid=9

here is the how to
http://www.ss64.com/nt/robocopy.html

Let me know how it goes
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

 
tomfolinsbeeAuthor Commented:
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.

bObmaster,

here the script I'm trying to run:

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

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!



0
 
plimpiasConnect With a Mentor Commented:
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.
0
 
tomfolinsbeeAuthor Commented:
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?

0
 
b0bmasterCommented:
Hi,

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
   close
   quit

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

Good Luck
0
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.