Is there a way to kill all files in a folder?

W

wbntravis

i do not want to kill the subdirectory or folder. ( It is an IE cache file
and I just want to go in and clean up what is in the cache.)
The folder, I want to leave alone....


Thanks in advance.
wbnTravis Oklahoma
 
M

Mike

Use this but be careful to get the path correct or you could have a very bad
day.

Sub Button1_Click()
Kill "c:\yourdirectory\*.*"
End Sub


Mike
 
T

Tom Ogilvy

Just to add a little info to Mikes caution: files deleted with Kill are not
placed in the recycle bin. They are just deleted.
 
P

Peter T

Although Mike has shown you how to delete files in a folder I'd be a bit
careful about messing with IE's cache files. There are dependencies between
the sub folders and hidden dat files. Unless you fully understand how IE
manages those files (I don't) it's generally recommended only to delete
their contents from a batch file at startup.

A bit more in this old thread. For some reason the OP's posts don't appear
visible in Google, (at least not for me) though they can be seen with 'Show
quoted text'

http://tinyurl.com/2vqrjv

Regards,
Peter T
 
W

wbntravis

Thanks all of you!
I did the folder and dos wildcard thing and it did not work for me
BEFORE I asked the question. Because it did not work... I asked
the question.

You all gave me great food for thought though-
which I will continue to study thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top