Forum Discussion

AshokKumarSahoo's avatar
AshokKumarSahoo
Contributor
8 years ago

How to delete zip folders under a normal folder in vbscript?

Here below codes delete only normal folders under  'DownloadEDGARHTML' folder.My requirement is need to delete all zipfolders(lets say more than 2  zip folders).Please let me know vbscript code for t...
  • tristaanogre's avatar
    8 years ago

    Zip folders aren't exactly folders.  So, I don't think calling the SubFolders property of the GetFolder method will work.

     

    Using the built in aqFileSystem object, I'd recommend something more like this to get your collection

     

    For Each file in aqFileSystem.FindFiles(StrFolderPath, '*.zip', false)
        file.Delete
    Next