Link to home
Start Free TrialLog in
Avatar of sravy
sravyFlag for United States of America

asked on

FTP ERROR 500 , DIRECTORY CANNOT BE DELETED

Hello Experts,I need a quick help with ftp rmdir command.
I am doing ftp through file ftp -s:ftp.file>>ftp.log
inside ftp.file, I have commands to transfer files , create directories etc.
Now , I want to include one more command for remove directory a directory - tranlog which has multiple sub-directories , files inside subdirectories, the  number of subdirectories may vary each time hence I cannot hard code what directores to delete in my script).
Note: I have all the necessary permissions on this directory.
I have tried:
rmdir tranlog
Error:550 tranlog: The directory is not empty
rmdir /SQ tranlog
rmdir tranlog /SQ
/SQ: The system cannot find the file specified
I am not sure how to pass arguments to rmdir to make it work like a deltree command in ms dos.
Please help.

Thanks
Avatar of kukno
kukno
Flag of Germany image

Hi,

you say:

>inside ftp.file, I have commands to transfer files , create directories etc.

well, if you create the directories in the batch file, you can delete them in reverse order, right?

Sampe:

mkdir /test
mkdir /test/test
mkdir /test/test/test
put xyz
delete xyz
rmdir /test/test/test
rmdir /test/test
rmdir /test

Regards
Kurt


ASKER CERTIFIED SOLUTION
Avatar of sravy
sravy
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
wait a moment. Are you talking about the DOS command rmdir or the ftp command rmdir? If it's the ftp command, then there is no /Q /S options! See the link I posted for a possible solution.

Regards
Kurt