Deleting a file from an FTP server with a Batch File
Moderator: DosItHelp
-
- Posts: 26
- Joined: 23 Dec 2013 07:07
Deleting a file from an FTP server with a Batch File
Hey guys.
I have an ftp server which I use for exchanges of information. Although once something has been uploaded with wput.exe, I have to manually remove it if I don't want it anymore. Any way to remove files from the ftp with a command using wput.exe or wget.exe? If not is there a way with another program?
Another thing also. I am not sure why wget.exe does not 'get' executable files? It simply doesn't find them. Does it have to be force to a binary form?
Any assistance is appreciated.
Matt.
I have an ftp server which I use for exchanges of information. Although once something has been uploaded with wput.exe, I have to manually remove it if I don't want it anymore. Any way to remove files from the ftp with a command using wput.exe or wget.exe? If not is there a way with another program?
Another thing also. I am not sure why wget.exe does not 'get' executable files? It simply doesn't find them. Does it have to be force to a binary form?
Any assistance is appreciated.
Matt.
Re: Deleting a file from an FTP server with a Batch File
I believe the people behind wput have also created wdel, I have no idea if it is cross-platform.
Re: Deleting a file from an FTP server with a Batch File
You should just be able to use the standard ftp command that has been built into Windows.
Re: Deleting a file from an FTP server with a Batch File
RightBehindu wrote:I am not sure why wget.exe does not 'get' executable files? It simply doesn't find them.
wget has a horde of switches and you'll find inclusions and exclusions there.
-
- Posts: 26
- Joined: 23 Dec 2013 07:07
Re: Deleting a file from an FTP server with a Batch File
Hey.
Thank you for your replies, although I sill have some problems. The built in ftp commands in cmd require a user to input things and manually enter commands to delete them, where as I would like it to delete automatically. If there is a way to do that, please correct me.
The wdel.exe I could not find. If you can give me a link it will be very helpful.
Thanks
Matt
Thank you for your replies, although I sill have some problems. The built in ftp commands in cmd require a user to input things and manually enter commands to delete them, where as I would like it to delete automatically. If there is a way to do that, please correct me.
The wdel.exe I could not find. If you can give me a link it will be very helpful.
Thanks
Matt
Re: Deleting a file from an FTP server with a Batch File
ftp.exe can be scripted but it sucks at deleting trees of files.
-
- Posts: 26
- Joined: 23 Dec 2013 07:07
Re: Deleting a file from an FTP server with a Batch File
Is there anything you recommend that I do? If it is the ftp.exe, could you give me a short run down on how one would do it? Because all it needs to do is delete one file or so at a time.
Re: Deleting a file from an FTP server with a Batch File
After you fill in the details you can call this batch file like this to delete myfile.zip:
FTPDEL myfile.zip
FTPDEL myfile.zip
Code: Select all
:: ftpdel.bat
@echo off
>file.tmp echo open ftp.mysite.com
>>file.tmp echo username
>>file.tmp echo password
>>file.tmp echo cd /directory
>>file.tmp echo binary
>>file.tmp echo del %~1
>>file.tmp echo disconnect
>>file.tmp echo bye
ftp -i -s:"file.tmp"
del "file.tmp"
Re: Deleting a file from an FTP server with a Batch File
RightBehindu wrote:The wdel.exe I could not find. If you can give me a link it will be very helpful.
I didn't say .exe, I'm on Ubuntu and it's available in that!
WDEL ManPage