Solved

VB - Deleting Temporary Internet Files

Posted on 2001-08-09
9
227 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
 
LVL 8

Expert Comment

by:Dave_Greene
ID: 6370877
Try...

Kill "C:\Windows\Temporary Internet Files\*.*"
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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 50 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now