开发者

zip files, zips the entire path

开发者 https://www.devze.com 2023-01-16 07:29 出处:网络
when i use winrar to zip a file, it开发者_如何转开发 for some reason zips the entire path. I am using vb.net for doing this.

when i use winrar to zip a file, it开发者_如何转开发 for some reason zips the entire path. I am using vb.net for doing this. here's the code -

  Public Sub RunArchive()
        Dim p As System.Diagnostics.Process = New System.Diagnostics.Process()
        sPath = "C:\Users\images\"
        sArchive = "C:\Users\images\test"

        p.StartInfo.FileName = ("C:\Program Files\WinRAR\rar.exe")
        p.StartInfo.Arguments = (" a -ms*.rar;*.zip;*.jpg;*.xls " & sArchive & ".rar " & sPath & "s23.jpg")
        p.Start()
        p.WaitForExit()
    End Sub

its zips to th specified folder, but when i try to unzip it, i see the whole path form users to images to s23.jog is in there. Why is that? I only need s23.jog in there when i unzip it not the preceding folders.

0

精彩评论

暂无评论...
验证码 换一张
取 消