Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VB - Deleting Temporary Internet Files

Posted on 2001-08-09
9
Medium Priority
?
241 Views
Last Modified: 2010-05-02
Anyone know how to implement VB code to delete the files in "C:\Windows\Temporary Internet Files"?

I have tried using "Dir" function and "FileSystemObject" object, however they do not recognize the entries in that directory as actual files.

Any help would be appreciated.
0
Comment
Question by:Marker
  • 2
  • 2
  • 2
  • +3
9 Comments
 
LVL 3

Expert Comment

by:andysalih
ID: 6370378
shell ("attrib -r c:\where\ever\*.*")
shell ("del c:\where\ever\*.*")

thats it

cheers
Andy


0
 
LVL 20

Expert Comment

by:hes
ID: 6370382
Here is the only example that I have found that works using vb code:

http://www.domaindlx.com/e_morcillo/scripts/cod/default.asp?page=ie#ietemp
0
 

Author Comment

by:Marker
ID: 6370465
To: andysalih,

This solution does not work, since the entries in "C:\Windows\Temporary Internet Files" directory do not appear as normal, hidden or system files to the DOS shell.

Thanks for the effort though :)

 
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 8

Expert Comment

by:Dave_Greene
ID: 6370877
Try...

Kill "C:\Windows\Temporary Internet Files\*.*"
0
 
LVL 8

Expert Comment

by:glass_cookie
ID: 6370903
Hi Dave_Greene!

Here's just my opinion.  The last time I manually deleted all the files in the "C:\Windows\Temporary Internet Files", my IE5 gave me some "cannot open the search page" or something like that.

So, using

Kill "C:\Windows\Temporary Internet Files\*.*"

may cause your IE to be down since it's more or less the smae thing.  Deleting of cookies killed my IE.  Mail would still work though.

---

On the other hand, you may want to kill those files using Dave_Greene's method, but do a check on whether it's a cookie ot not.  Remember, delete those files only IF they are NOT cookies.  The one and only thing that caused the 'death' of my IE was the deleting of cookies.  Delete any thing you want in that folder, just don't touch the cookies.

That's it!

glass cookie : )
0
 
LVL 16

Accepted Solution

by:
Richie_Simonetti earned 200 total points
ID: 6371082
0
 

Author Comment

by:Marker
ID: 6373534
To Richie Simonetti,

Thanks, this example is nice and clean and works well, I would recommend it to others.


To Glass Cookie,

Thanks for the feedback, the example from Ritchie checks if the entry is a cookie and avoids the mishaps you may have encountered by deleting any cookies in this directory.

To Hes,

This code does work, but seems a little complicated (I am a total Newbie at VB so it's easy to confuse me...:) the example from Ritchie is a cleaner method.

Thanks to all who replied....

0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6373607
You are welcome. Glad to help.
0
 
LVL 20

Expert Comment

by:hes
ID: 6374156
No problem, just glad you got a solution you like and can use :)
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question