CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2001
    Location
    Israel
    Posts
    116

    Temporary Internet Files

    Hi

    i am trying to delete all the files in the folder
    "Temporary Internet Files" by code

    i tryed to use 'dir$' and 'kill' functions but it is not working

    i am trying to access the explorer and activate the button 'Delete Files..'


    any idea ???

    limor


  2. #2
    Join Date
    Jun 2001
    Location
    MO, USA
    Posts
    2,868

    Re: Temporary Internet Files

    Add a reference to Windows Scripting Runtime DLL (c:\windows\system\scrrun.dll) and try this behind a button:


    private Sub Command1_Click()
    Dim fs as FileSystemObject
    Dim fld as Folder
    Dim f as File

    set fs = new FileSystemObject
    set fld = fs.GetFolder("C:\Windows\Temporary Internet Files")
    If fld.Files.Count > 0 then
    for Each f In fld.Files
    If f.Attributes <> (ReadOnly Or System Or Directory) then
    f.Delete false
    End If
    next
    End If

    set f = nothing
    set fld = nothing
    set fs = nothing

    End Sub






Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured