Results 1 to 6 of 6

Deleting Files Using FSO

Threaded View

  1. #1
    Registered User
    Join Date
    07-06-2007
    Posts
    70

    Question Deleting Files Using FSO

    Hi all,

    I have the following wee script which deletes pdf files in a folder.

    Is there a way i can customize so that it check all subfolders within folder?

    Function DeletePDFS()
    Dim fso As Object, file As Object, folder As Object, subfolder As Object, s As String
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set folder = fso.GetFolder("C:\Documents and Settings\c.connor\My Documents\deletePDFS\filesToDelete\")
    For Each file In folder.Files
    
    fso.DeleteFile "C:\Documents and Settings\c.connor\My Documents\deletePDFS\filesToDelete\*.pdf"
    
    Next file
    
    End Function
    Thanks in advance!!
    C
    Last edited by cjconnor24; 05-12-2009 at 11:00 AM. Reason: pasted wrong macro

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1