Search code examples
sessionbatch-fileftpdos

How to delete local computer files in the ftp session with a file. scr?


I have a .bat file (test.bat) :

ftp -s:Test_DOWN.scr
pause

I have a .scr file (Test_DOWN.scr) :

open ftp01.citobi.be
USERNAME
PASSWORD
prompt n
mput *.csv
quit
cd C:\...
del *.csv

The problem is that I want to remove files in my directory C:... but when I execute test.bat, it doesn't execute the last two lines.

I want to know if it is possible to run these two lines in the same script after ftp commands?

ps : When I launch prompt command from start --> run --> cmd and I connect to ftp. The quit ftp command works well, I pass the ftp session to host session. But with the .bat file, after quitcommand, it's over..


Solution

  • I solved the problem...

    I used ! ftp command (escape to the shell).

    !del *.csv
    

    And it works well.