0

Possible Duplicate:
How to move files using FTP commands

I am trying to move a file with only .csv format from local FTP to a FTP directory. I couldn't move the file to a directory via batch script. So I need help please. I am new to batchfile script.

open FTP ADDRESS 
USER
PASSWORD
prompt
bin

??????????????

bye

Thanks from now.

Community
  • 1
  • 1
Luai Kalkatawi
  • 1,492
  • 5
  • 25
  • 51
  • There are multiple good tutorials on (MS) FTP available online. What commands have you tried already? Why they are not a good fit for your goal? What specific criteria make it difficult? Try to solve your problem yourself before you post - if you're stuck I'm sure there will be people able (and happy) to help. Otherwise - sorry we're not your google HID. – wmz Jul 26 '12 at 10:20
  • I have searched a lot but could do it I have did lots of things via searching in google but couldn't do what I want now. I would not ask till I am very stuck. As I said above I am new to btach script comand. – Luai Kalkatawi Jul 26 '12 at 10:39
  • As I understand from your comment on Bali's answer, you want to move a file within FTP? From one FTP directory to another? If that's the case you should edit your question to make it easier to understand. An explanation why you could not move the file via batch would help too – wmz Jul 26 '12 at 12:22

1 Answers1

1

You can use the rename command to move a file on the ftp server, as pointed out by @wmz's comment to a duplicate question.

open FTP ADDRESS 
USER
PASSWORD
prompt
bin
rename file.csv anotherfolder\file.csv
bye
Community
  • 1
  • 1
Bali C
  • 30,582
  • 35
  • 123
  • 152
  • Thanks Bali. The file I want to move is in the ftp root so I would like to move it to the a directory in the ftp root. – Luai Kalkatawi Jul 26 '12 at 11:29
  • So you want to move the file on the ftp server to a folder further down? i.e. `ftp://file.txt => ftp://folder/file.txt` – Bali C Jul 26 '12 at 12:14
  • Yes I want to move the file in the FTP server to a diractory in the FTP. – Luai Kalkatawi Jul 26 '12 at 13:09
  • See my updated answer, FTP doesn't seem to have a command for moving files. My answer downloads it to local, deletes remote, then puts it back onto remote in a different folder, if that makes sense :) – Bali C Jul 26 '12 at 13:20
  • actually there is one, please see my comment on OP's question. – wmz Jul 26 '12 at 13:52
  • Thanks Bali. Is this code is picking the file from the local? I get this problem the Archive\user.txt: file is not found and it is deleted to. – Luai Kalkatawi Jul 26 '12 at 14:01
  • @wmz Ah right, I saw that somewhere else but I wasn't sure if it would work, I will put that in my answer, thanks! – Bali C Jul 26 '12 at 14:14
  • @LuaiKalkatawi Sorry, my answer was a bit more complicated than it needed to be, as pointed out by wmz, see now, hopefully that will help you :) – Bali C Jul 26 '12 at 14:18
  • Thanks Bali it works I appreciate you and thanks to wmz to. – Luai Kalkatawi Jul 27 '12 at 07:24
  • Hi Bali, what if I want to move just .csv files. I have used this code but it didn't work ' rename *.csv FolderName\\*.csv ' – Luai Kalkatawi Jul 27 '12 at 08:38
  • Hiya, hmmm, I'm not sure about that one. That command would be what I would suggest if you hadn't already! :) You might have to download them to your local PC, then upload them again to the new folder. – Bali C Jul 27 '12 at 09:27