title: Delete folder on multiple usb drives VBS
body: <p>I am looking to delete folder on multiple usb driver at the same time. </p>
  
  <pre><code>sDeleteFolder = "\Test"
  Set oFS = CreateObject("Scripting.FileSystemObject")
  Set dUSBKeys = ScanForUSBKeys()
  For Each oUSBKey in dUSBKeys.Keys
      If Left(oUSBKey, 1) = "\" Then
         sKey = oUSBKey
      Else
          sKey = oUSBKey &amp; "\"
      End If
      oFS.DeleteFolder sdeleteFolder, sKey
  Next
  Set dUSBKeys = Nothing
  Set oFS = Nothing
  
   MsgBox "Done Del all the folder from USB Drivs", vbOKOnly+VBINformation+VBSystemModal, "DONE"
  Function ScanForUSBKeys()
      Set oWMI = GetObject("winmgmts:\\.\root\cimv2")
      Set dTemp = CreateObject("Scripting.Dictionary")
  Set cDisks = oWMI.ExecQuery("Select InterfaceType,MediaType,PNPDeviceID,DeviceID,Size from Win32_DiskDrive")
  For Each oDisk in cDisks
      If InStr(LCase(oDisk.InterfaceType),"usb") &gt; 0 AND InStr(LCase(oDisk.MediaType),"removable") &gt; 0 _
        AND InStr(LCase(oDisk.PNPDeviceID),"blackberry") = 0 AND InStr(LCase(oDisk.PNPDeviceID),"ipod") = 0 _
        AND NOT oDisk.PNPDeviceID = "" Then
          Set cDrivePartitions = oWMI.ExecQuery("ASSOCIATORS OF {Win32_DiskDrive.DeviceID='" &amp; _
                                oDisk.DeviceID &amp; "'} WHERE AssocClass = Win32_DiskDriveToDiskPartition" )
          For Each oDrivePartition in cDrivePartitions
              Set cDriveLetters = oWMI.ExecQuery("ASSOCIATORS OF {Win32_DiskPartition.DeviceID='" &amp; _
                                  oDrivePartition.DeviceID &amp; "'} WHERE AssocClass = Win32_LogicalDiskToPartition")
              For Each oDriveLetter in cDriveLetters
                  dTemp.Add oDriveLetter.DeviceID, 1
              Next
              Set cDriveLetters = Nothing
          Next
          Set cDrivePartitions = Nothing
      End If
  Next
  Set cDisks = Nothing
  Set ScanForUSBKeys = dTemp
  Set dTemp = Nothing
  Set oWMI = Nothing
  End Function
  </code></pre>
  
  <p>I keep getting a error : </p>
  
  <pre><code> Type mismatch: 'oFs.DeleteFolder'  
   Line 12   Char 5
  </code></pre>