Delete file from Server

Hi all,
I'm using WPut and WGet to upload and download files to a FTP Server but need some Access VBA code to delete a file from there please.
Maybe some FTP Shell command?

Thanks
Pierre
Pierre KAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kanti PrasadCommented:
Hi

You can use
 
delete  filename.ext
or
mdelete *.ext
0
Pierre KAuthor Commented:
@Kanti - thanks for the reply.
Could you provide more info as to how I would implement this in Access VBA please?
As explained the file I need to delete resides on my Web Server.
So I need some FTP command to delete the specific file
0
Kanti PrasadCommented:
Hi

The one I gave you is to run it as a FTP command. Try it and if it works just put it as a .bat file and run it.
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

Pierre KAuthor Commented:
@Kanti - I created a bat file with ref to the http path to the file but I'm getting an error stating that the 'delete' or 'mdelete' command doesn't exist
0
Kanti PrasadCommented:
Hi

Initially run just with the delete  on that server then we can look giving the path name.

FTP> prompt
FTP> delete filename*.ext  |yes
0
Pierre KAuthor Commented:
@Kanti - OK I understand but I need the full code to login and do the delete from within VBA code.
I have an idea how to do it via Command Prompt but not sure how to do it all the way with VBA code.
Sorry - hope that make sense?
0
Kanti PrasadCommented:
Hi

Just record a macro in xls and copy this

Sub macro()
Kill "C:\yourdirectorypath\*.ext"
End Sub
0
Gustav BrockCIOCommented:
There is no WDel for Windows, but you can run a script for the FTP utility:

WDel.cmd
@echo off
>file.txt echo open ftp.mysite.com
>>file.txt echo username
>>file.txt echo password
>>file.txt echo cd  /directory
>>file.txt echo binary
>>file.txt echo del %1
>>file.txt echo disconnect
>>file.txt echo bye

ftp -i -s:"file.txt"
del "file.txt"

Open in new window

/gustav
1
Pierre KAuthor Commented:
@Gustav - Ahhh - that sounds far more like the code I need.
I would only be able to test it in the morning (our time).
Only need to figure out how to put it in a Function or VBA script - would be nice if you could help with that...
Thanks
0
Gustav BrockCIOCommented:
Here's an example:

Upload file via FTP from VBA

/gustav
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Pierre KAuthor Commented:
@Gustav - Thanks a lot - worked like a dream!
0
Gustav BrockCIOCommented:
You are welcome!

/gustav
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.