Author |
Message |
Ron Hurl #1 / 19
|
 Clean out of Temp Internet , History, recent Folders
Can anyone please help me with vb code to cleanout the special directories of temp Internet Recent Document History folders etc thanks in advance ron hurley
|
Wed, 21 May 2003 12:47:58 GMT |
|
 |
SmAc #2 / 19
|
 Clean out of Temp Internet , History, recent Folders
Ron, The example below will delete all files from the recent directory. Do similar for the other folders you wish to delete. Hmm actually now that I reread your post I realise that this code won't delete files from "temporary internet files" but it will from the other folders. Regards, SmAc Option Explicit Dim RecentFiles As String Dim DeleteFile As String RecentFiles = "c:\windows\recent\" DeleteFile = Dir(RecentFiles & "*.*") Do Until DeleteFile = "" Kill RecentFiles & DeleteFile DeleteFile = Dir Loop
Quote: > Can anyone please help me with vb code to cleanout the special > directories of > temp Internet > Recent > Document > History folders etc > thanks in advance > ron hurley
|
Wed, 18 Jun 1902 08:00:00 GMT |
|
 |
OTSE #3 / 19
|
 Clean out of Temp Internet , History, recent Folders
Quote: > DeleteFile = Dir(RecentFiles & "*.*") > Do Until DeleteFile = "" > Kill RecentFiles & DeleteFile > DeleteFile = Dir > Loop
You can shorten the above to one line: Kill "c:\windows\recent\*.*" Regards, Otser.
|
Wed, 18 Jun 1902 08:00:00 GMT |
|
 |
No Junk Mai #4 / 19
|
 Clean out of Temp Internet , History, recent Folders
Dear Programmer, Use code that ask/points to the appropriate directories. That way anyone can use it... I have started programming this afternoon after seeing the request. kk
Quote:
> > Not under NT (usually) or on non-English versions of Windows and maybe > > not on a lot of English systems. Not everybody installs to C:\Windows > I know not everyone installs to c:\windows, but I was shortening > his particular example, which presumably works fine for him. :) > Regards, Otser.
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =----- http://www.newsfeeds.com - The #1 Newsgroup Service in the World! -----== Over 80,000 Newsgroups - 16 Different Servers! =-----
|
Wed, 18 Jun 1902 08:00:00 GMT |
|
 |
Bob Butle #5 / 19
|
 Clean out of Temp Internet , History, recent Folders
Quote:
> > DeleteFile = Dir(RecentFiles & "*.*") > > Do Until DeleteFile = "" > > Kill RecentFiles & DeleteFile > > DeleteFile = Dir > > Loop > You can shorten the above to one line: > Kill "c:\windows\recent\*.*"
Not under NT (usually) or on non-English versions of Windows and maybe not on a lot of English systems. Not everybody installs to C:\Windows You need to use the GetWindowsDirectory API call or, better, the SHGetSpecialFolderLocation API call. -- Please reply via the newsgroup only Sent via Deja.com http://www.deja.com/ Before you buy.
|
Thu, 22 May 2003 10:16:00 GMT |
|
 |
OTSE #6 / 19
|
 Clean out of Temp Internet , History, recent Folders
Quote: > Not under NT (usually) or on non-English versions of Windows and maybe > not on a lot of English systems. Not everybody installs to C:\Windows
I know not everyone installs to c:\windows, but I was shortening his particular example, which presumably works fine for him. :) Regards, Otser.
|
Thu, 22 May 2003 12:18:05 GMT |
|
 |
SmAc #7 / 19
|
 Clean out of Temp Internet , History, recent Folders
so you can. I actually tried this and it didn't work. but I retried it and now it does. Must've done a dreaded typo or some such thing the first time :) thanx for the correction. SmAc
Quote:
> > DeleteFile = Dir(RecentFiles & "*.*") > > Do Until DeleteFile = "" > > Kill RecentFiles & DeleteFile > > DeleteFile = Dir > > Loop > You can shorten the above to one line: > Kill "c:\windows\recent\*.*" > Regards, Otser.
|
Thu, 22 May 2003 16:02:09 GMT |
|
 |
SmAc #8 / 19
|
 Clean out of Temp Internet , History, recent Folders
yes you are right but I told him to use similar code for the directories he wishes to delete. Presumably he knows where they are :) SmAc
Quote:
> > > DeleteFile = Dir(RecentFiles & "*.*") > > > Do Until DeleteFile = "" > > > Kill RecentFiles & DeleteFile > > > DeleteFile = Dir > > > Loop > > You can shorten the above to one line: > > Kill "c:\windows\recent\*.*" > Not under NT (usually) or on non-English versions of Windows and maybe > not on a lot of English systems. Not everybody installs to C:\Windows > You need to use the GetWindowsDirectory API call or, better, the > SHGetSpecialFolderLocation API call. > -- > Please reply via the newsgroup only > Sent via Deja.com http://www.deja.com/ > Before you buy.
|
Thu, 22 May 2003 16:05:11 GMT |
|
 |
SmAc #9 / 19
|
 Clean out of Temp Internet , History, recent Folders
having looked back on some passed code of mine I have used the one line approach that otser suggested. Dunno what lead me along that line of thought when I posted my initial post. But i suppose it has shown somebody how to scroll through every file in a directory anyhow. Cheers, SmAc
Quote: > so you can. I actually tried this and it didn't work. but I retried it and > now it does. Must've done a dreaded typo or some such thing the first time > :) thanx for the correction. > SmAc
> > > DeleteFile = Dir(RecentFiles & "*.*") > > > Do Until DeleteFile = "" > > > Kill RecentFiles & DeleteFile > > > DeleteFile = Dir > > > Loop > > You can shorten the above to one line: > > Kill "c:\windows\recent\*.*" > > Regards, Otser.
|
Wed, 18 Jun 1902 08:00:00 GMT |
|
 |
SmAc #10 / 19
|
 Clean out of Temp Internet , History, recent Folders
actually ignore my other posts regarding otser's post. If you try to use a wildcard with the kill command it does not work. I have just tried it again many times and got a file i/o path access error. So i looked back at my old code again and realised it was not relevant to this thread. OTSER try it as with my VB it dun work (VB6 SP4) SmAc
Quote:
> > DeleteFile = Dir(RecentFiles & "*.*") > > Do Until DeleteFile = "" > > Kill RecentFiles & DeleteFile > > DeleteFile = Dir > > Loop > You can shorten the above to one line: > Kill "c:\windows\recent\*.*" > Regards, Otser.
|
Wed, 18 Jun 1902 08:00:00 GMT |
|
 |
OTSE #11 / 19
|
 Clean out of Temp Internet , History, recent Folders
Quote: > If you try to use a wildcard with the kill command it does not work.
I've been using wildcards with the Kill command for ages with no problems whatsoever. I'm using VB5 Pro. Don't know why it doesn't work for you, but as Ash said in Alien, "you have my sympathies". :) Regards, Otser.
|
Fri, 23 May 2003 08:19:19 GMT |
|
 |
SmAc #12 / 19
|
 Clean out of Temp Internet , History, recent Folders
Kewl I find that interesting. I am using vb6 and no go. I am almost tempted to reinstall vb5 to see if it works. Anyone else got any input on this? Regards, SmAc
Quote:
> > If you try to use a wildcard with the kill command it does not work. > I've been using wildcards with the Kill command for ages with no > problems whatsoever. I'm using VB5 Pro. Don't know why it doesn't > work for you, but as Ash said in Alien, "you have my sympathies". :) > Regards, Otser.
|
Wed, 18 Jun 1902 08:00:00 GMT |
|
 |
#13 / 19
|
 Clean out of Temp Internet , History, recent Folders
|
Wed, 18 Jun 1902 08:00:00 GMT |
|
 |
OTSE #14 / 19
|
 Clean out of Temp Internet , History, recent Folders
Quote: > Kewl I find that interesting. I am using vb6 and no go. I am almost tempted > to reinstall vb5 to see if it works. Anyone else got any input on this?
What does the Online Help say for the Kill statement in VB6? Here is what it says (in part) for VB5 Pro: "Kill supports the use of multiple-character (*) and single-character (?) wildcards to specify multiple files." Regards, Otser.
|
Wed, 18 Jun 1902 08:00:00 GMT |
|
 |
#15 / 19
|
 Clean out of Temp Internet , History, recent Folders
|
Wed, 18 Jun 1902 08:00:00 GMT |
|
|