Page 1 of 2
Delete directory and files with subdirectorys with ftp command line
Posted: 11 Sep 2017 17:45
by r2du-soft
Hi
How can Delete directory and files with subdirectorys with ftp command line?
For example i have a folder with name folderB1
In that folder is many files and subfolders with files
My problem is that i dontknow subfolders name for delete thats one by one
Now how can Delete directory and files with subdirectorys?
Re: Delete directory and files with subdirectorys with ftp command line
Posted: 11 Sep 2017 18:25
by Hackoo
Re: Delete directory and files with subdirectorys with ftp command line
Posted: 11 Sep 2017 20:05
by Squashman
Re: Delete directory and files with subdirectorys with ftp command line
Posted: 12 Sep 2017 07:53
by r2du-soft
my problem this...
when i want remove directory,then show me message directory not empty...
i how can delete AAA folder with sub directory and files?
i see links but i have problem again...
is possible give me example?
thanks
Re: Delete directory and files with subdirectorys with ftp command line
Posted: 12 Sep 2017 08:12
by Compo
You will likely need to run delete or mdelete first to remove files before removing the directory with rmdir.
It doesn't look however like there is a mrmdir command so you may only be able to remove a single one at a time.
Re: Delete directory and files with subdirectorys with ftp command line
Posted: 12 Sep 2017 08:41
by r2du-soft
Is true
But when i dont know sub folders name,how can goto folder for remove files?
Re: Delete directory and files with subdirectorys with ftp command line
Posted: 12 Sep 2017 09:34
by aGerman
Probably something like that:
Untested though.
Steffen
Re: Delete directory and files with subdirectorys with ftp command line
Posted: 12 Sep 2017 11:23
by r2du-soft
Yes i test this and work for delete files in folder
But how can delete folders that do not know their name؟
For full example see this:
In folder AAA is several folders and files
If i dont know folders name cant goto inside folder to be empty that and after remove empty folder
My problem is find folders name for delete folder files and after delete folder
Re: Delete directory and files with subdirectorys with ftp command line
Posted: 12 Sep 2017 11:28
by aGerman
I'm not aware of any possibility to do that using the Windows FTP command. Most likely you have to find a 3rd party utility for this task.
Steffen
Re: Delete directory and files with subdirectorys with ftp command line
Posted: 12 Sep 2017 12:29
by r2du-soft
Thanks for the help
Is possible do this work with any software with call with cmd to send parameters?
Re: Delete directory and files with subdirectorys with ftp command line
Posted: 12 Sep 2017 12:48
by aGerman
Google told me something about NcFTP which seems to support option -r for rmdir.
Steffen
Re: Delete directory and files with subdirectorys with ftp command line
Posted: 21 Sep 2017 09:50
by r2du-soft
NcFTP good work rmdir -r but i have another problem...
in ftp command i can use like this:
Code: Select all
@echo off
echo open FTPADDRESS> DeleteDirectory2.txt
echo FTPUSERNAME>> DeleteDirectory2.txt
echo FTPPASSWORD>> DeleteDirectory2.txt
echo CD AAA>>DeleteDirectory2.txt
echo prompt>>DeleteDirectory2.txt
echo mdelete *>>DeleteDirectory2.txt
echo cd ..>>DeleteDirectory2.txt
echo RMDIR AAA>>DeleteDirectory2.txt
echo disconnect>>DeleteDirectory2.txt
echo quit>>DeleteDirectory2.txt
ftp -s:DeleteDirectory2.txt
del DeleteDirectory2.txt
is possible i run commands in NCFTP like this? write code in a text file and call them with NCFTP?
Re: Delete directory and files with subdirectorys with ftp command line
Posted: 22 Sep 2017 07:44
by r2du-soft
not possible remove a directory without name in ftp?
in ncftp i need like this:
Code: Select all
@echo off
echo open -u FtpAddress> ftpcmd.txt
echo FtpUsername>> ftpcmd.txt
echo FtpPassword>> ftpcmd.txt
echo mkdir AAA>>ftpcmd.txt
echo cd AAA>>ftpcmd.txt
echo mkdir 1A>>ftpcmd.txt
echo mkdir 2B>>ftpcmd.txt
echo mkdir 3C>>ftpcmd.txt
echo cd ..>>ftpcmd.txt
echo cd AAA>>ftpcmd.txt
echo rm -r *>> ftpcmd.txt
ncftp -f ftpcmd.txt
del ftpcmd.txt
but not worked!
Re: Delete directory and files with subdirectorys with ftp command line
Posted: 22 Sep 2017 10:49
by aGerman
Sorry, but neither do I know NcFTP (I was just googling for you) nor do I own any FTP server share where I could test it. Just follow their documentation links
http://www.ncftp.com/ncftp/Steffen
Re: Delete directory and files with subdirectorys with ftp command line
Posted: 22 Sep 2017 13:18
by r2du-soft
aGerman wrote:Sorry, but neither do I know NcFTP (I was just googling for you) nor do I own any FTP server share where I could test it. Just follow their documentation links
http://www.ncftp.com/ncftp/Steffen
I tried by:
http://www.ncftp.com/ncftp/but I did not succeed
i send to you in PM a FtpAddress and Username and Password for testing codes
If possible test ncftp or ftp for delete folder with sub folders
For example i have a directory with name 'Root' and in that is many folders without file
I want to delete directory 'Root' with all sub directorys (if i don't know sub folders names)