How to delete files from zip with VBScript

前端 未结 1 1776
误落风尘
误落风尘 2020-12-12 08:05

Im very new to VBScript (this is my first time ever using it). So far I\'ve copied and altered my way into getting as far as I am.

I have an APK file that is too bi

相关标签:
1条回答
  • 2020-12-12 08:31

    Use the MoveHere method to move an item out of the zip file:

    zipfile = "C:\path\to\your.zip"
    fname   = "some.file"
    dst     = "C:\some\folder"
    
    Set app = CreateObject("Shell.Application")
    For Each f In app.NameSpace(zipfile).Items
      If f.Name = fname Then
        app.Namespace(dst).MoveHere(f)
      End If
    Next
    

    Then delete the files from the dst folder:

    Set fso = CreateObject("Scripting.FileSystemObject")
    fso.DeleteFile fso.BuildPath(dst, fname), True
    
    0 讨论(0)
提交回复
热议问题