Welcome to Dream.In.Code
Getting VB Help is Easy!

Join 86,399 VB Programmers. There are 1,461 online right now! Ask your question and get quick answers from Dream.In.Code experts. Join the #1 programming help community on the internet! Registration is fast and FREE... Join Now!

Chat LIVE With a VB Expert
Powered by LivePerson.com

Register to Make This Box Go Away!

Temporary Internet Files Help

 
Reply to this topicStart new topic

Temporary Internet Files Help

Rating  5
SniperKingCK9999
post 9 May, 2008 - 09:12 AM
Post #1


New D.I.C Head

*
Joined: 9 May, 2008
Posts: 1



Hello

I am currently working on a program and i have come across a problem, I am using Visual Basic 5.0 and i need to delete all the files in the Temporary Internet Files dir which is:

C:\Documents and Settings\User_Profile\Local Settings\Temporary Internet Files

I am using Windows Xp, And this is the code that i am trying to use but it dosent work:


kill "C:\Documents and Settings\User_Profile\Local Settings\Temporary Internet Files\*.*"

Please Help
User is offlineProfile CardPM
Go to the top of the page
+Quote Post


born2c0de
post 10 May, 2008 - 12:27 AM
Post #2


printf("I'm a %XR",195936478);

Group Icon
Joined: 26 Nov, 2004
Posts: 3,298

The Kill Function does not support Wildcards.
You'll need to get the filename of every file in the temp directory using the FindFirstFile, FindNextFile API Functions and delete them individually or execute a batch file ( using Shell() ) which has the following contents:

CODE
@echo off
cd <put directory here>
del /q *.*
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

lakhanmahajan
post 10 May, 2008 - 10:45 AM
Post #3


New D.I.C Head

*
Joined: 4 May, 2008
Posts: 13

QUOTE(SniperKingCK9999 @ 9 May, 2008 - 09:12 AM) *

Hello

I am currently working on a program and i have come across a problem, I am using Visual Basic 5.0 and i need to delete all the files in the Temporary Internet Files dir which is:

C:\Documents and Settings\User_Profile\Local Settings\Temporary Internet Files

I am using Windows Xp, And this is the code that i am trying to use but it dosent work:


kill "C:\Documents and Settings\User_Profile\Local Settings\Temporary Internet Files\*.*"

Please Help


Use this which is help u to delete file's
CODE

Dim ob As Object
Set ob = CreateObject("Scripting.FileSystemObject")
ob.deletefile "C:\*.txt"

it will delete all the text file's c:\
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

born2c0de
post 10 May, 2008 - 10:15 PM
Post #4


printf("I'm a %XR",195936478);

Group Icon
Joined: 26 Nov, 2004
Posts: 3,298

Interesting, I hope this works.
Just remember that FSO's require you to have the appropriate permissions to create/edit/delete files.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 5/17/08 06:24AM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month