0

I am trying to write an program to extract zipped files using vb.net. I am facing a problem - when I try to extract the files, it ask fro replacement agreement, but I need to extract that files without asking for my an agreement.

This is the code I use:

Dim shObj As Object =        Activator.CreateInstance(Type.GetTypeFromProgID("Shell.Application"))
Dim outputFolder As String = appPath
Dim inputZip As String = appPath + "\patchFile.zip"
    IO.Directory.CreateDirectory(outputFolder)

    'Declare the folder where the items will be extracted.
    Dim output As Object = shObj.NameSpace((outputFolder))

    'Declare the input zip file.
    Dim input As Object = shObj.NameSpace((inputZip))

    'Extract the items from the zip file.
    output.CopyHere((input.Items), 4)
zero323
  • 322,348
  • 103
  • 959
  • 935

1 Answers1

-1

I think you can use the second parameter of CopyHere to respond Yes To All for any dialog box displayed and it should avoid your dialog box.

output.CopyHere((input.Items), 16)

Edit :

And if you still need option 4 to not show progress, you can combine both so it would be 20 instead of 16

  • thank you ver much but i have another question after extract processes done , i need to make statement with if , to do function after extraction process – khaled atef Apr 15 '18 at 07:06
  • Knowing that CopyHere is async, I don't think there is an embedded way to do it but you can take a look at this : https://stackoverflow.com/questions/10042801/how-to-check-when-shell32-folder-copyhere-is-finished It seems to be two alternative ways to accomplish it – C. Dallaire Apr 16 '18 at 11:49