title: Unzip file silently and without dialog box to overwrite
body: <p>I am working on vbscript to unzip the multiple files one after another.</p>
  
  <p>I am using below code </p>
  
  
  
  <pre class="lang-vb prettyprint-override"><code>Dim folder(3)
  folder(0) = "UBO90R1"
  folder(1) = "UBO90R2"
  folder(2) = "UBO100R1"
  folder(3) = "UBO100R2"
  
  For i = 0 To 3
      unzip_Source = "D:\Autobackup\" &amp; folder(i) &amp; ".zip"
      unzip_destination = "D:\Autobackup_unzip\" &amp; folder(i) &amp;"\"
  
      Call ExtractFilesFromZip(unzip_Source,unzip_destination)
  
      WScript.Echo "unzip Finished"
  Next
  
  Sub ExtractFilesFromZip(pathToZipFile, dirToExtractFiles)
      Dim fso
      Set fso = CreateObject("Scripting.FileSystemObject")
  
      pathToZipFile = fso.GetAbsolutePathName(pathToZipFile)
      dirToExtractFiles = fso.GetAbsolutePathName(dirToExtractFiles)
  
      If (Not fso.FileExists(pathToZipFile)) Then
          WScript.Echo "Zip file does not exist: " &amp; pathToZipFile
          Exit Sub
      End If
  
      If Not fso.FolderExists(dirToExtractFiles) Then
          WScript.Echo "Directory does not exist: " &amp; dirToExtractFiles
          Exit Sub
      End If
  
      dim sa  : Set sa = CreateObject("Shell.Application")
      Dim zip : Set zip = sa.NameSpace(pathToZipFile)
      Dim d   : Set d = sa.NameSpace(dirToExtractFiles)
  
      d.CopyHere zip.items, 4
  
      Do Until zip.Items.Count &lt;= d.Items.Count
          WScript.Sleep(200)
      Loop
  End Sub
  </code></pre>
  
  <p>The Problem currently I have that if the folder or file is already exist than it open the dialog to the user to select any option Overwrite, keep both file etc.</p>
  
  <p>If I change the following line from the code</p>
  
  <pre class="lang-vb prettyprint-override"><code>d.CopyHere zip.items, 4
  'Integer 4 didn't show the progress bar
  </code></pre>
  
  <p>to </p>
  
  <pre class="lang-vb prettyprint-override"><code>d.CopyHere zip.items, 16
  'Integer 16 overwrite the existing file but it shows the progress bar.
  </code></pre>
  
  <p>I would like to overwrite the existing file without any dialog box and without any progress bar. </p>
  
  <p>PS: Code to unzip copied from <a href="https://www.techcoil.com/blog/handy-vbscript-functions-for-dealing-with-zip-files-and-folders/" rel="nofollow noreferrer">here</a>.</p>