title: vbsScript remove space echo
body: <p>Hello im making unhide usb files i modify konboot usb installer to usb unhide</p>
  
  <p><strong>CMD</strong>
  cscript //Nologo  USB.vbs>unhide.bat</p>
  
  <pre><code>Wscript.Echo "attrib -s -h -r /s /d "&amp; SingleLogicalDisk.DeviceID,"\*.*"
  </code></pre>
  
  <p>the output 
  attrib -s -h -r /s /d F:(have space here)*.*</p>
  
  <p>i need no space on F:(Here)*.*</p>
  
  <p>my final output i want
  attrib -s -h -r /s /d F:*.*</p>
  
  <p><strong>vbscript</strong></p>
  
  <pre><code>Dim query 
  Dim WMBIObj 
  Dim AllDiskDrives 
  Dim SingleDiskDrive 
  Dim AllLogicalDisks 
  Dim SingleLogicalDisk 
  Dim AllPartitions 
  Dim Partition 
  Dim result
  Dim textmsg
  Dim wshShell
  Dim FileObj
  Dim Counter
  
  set FileObj = CreateObject("Scripting.FileSystemObject")
  set wshShell = wscript.createObject("wscript.shell")
  Set WMBIObj = GetObject("winmgmts:\\.\root\cimv2")
  Set AllDiskDrives = WMBIObj.ExecQuery("SELECT * FROM Win32_DiskDrive where InterfaceType='USB'") ' 
  For Each SingleDiskDrive In AllDiskDrives 
      counter = counter + 1
      query = "ASSOCIATORS OF {Win32_DiskDrive.DeviceID='" + SingleDiskDrive.DeviceID + "'} WHERE AssocClass = Win32_DiskDriveToDiskPartition" 
      Set AllPartitions = WMBIObj.ExecQuery(query) 
      For Each Partition In AllPartitions 
          query = "ASSOCIATORS OF {Win32_DiskPartition.DeviceID='" + Partition.DeviceID + "'} WHERE AssocClass = Win32_LogicalDiskToPartition"
          Set AllLogicalDisks = WMBIObj.ExecQuery (query) 
          For Each SingleLogicalDisk In AllLogicalDisks  
  
              textmsg =   "============================================" &amp; VbCr &amp; _ 
                          "DeviceID: " &amp; SingleDiskDrive.DeviceID &amp; VbCr &amp; _ 
                          "Logical Drive: "  &amp; SingleLogicalDisk.DeviceID &amp; VbCr &amp; _ 
                          "Model: " &amp; SingleDiskDrive.Model &amp; VbCr &amp; _ 
                          "Manufacturer: " &amp; SingleDiskDrive.Manufacturer &amp; VbCr &amp; _
                          "============================================" &amp; VbCr &amp; _ 
                          "Would you like to use this drive as destination?" &amp; VbCr &amp; _ 
                          "Warning, disk data may be overwritten"
              result = MsgBox(textmsg, vbQuestion + vbOKCancel, "USB")
  
              if result = vbOk Then
                          WScript.Echo "echo DeviceID: " &amp; SingleDiskDrive.DeviceID  
                          WScript.Echo "echo Logical Drive: "  &amp; SingleLogicalDisk.DeviceID
                          WScript.Echo "echo Model: " &amp; SingleDiskDrive.Model
                          WScript.Echo "echo Manufacturer: " &amp; SingleDiskDrive.Manufacturer
                          Wscript.Echo "attrib -s -h -r /s /d "&amp; SingleLogicalDisk.DeviceID,"\*.*"
                          wshShell.Run "unhide.bat"
                          WScript.quit 
  
                  MsgBox "Your USB is ready!", vbInformation + vbOKOnly, "USB"
                  WScript.quit 
              End If
          Next
      Next 
  Next 
  if counter = 0 Then
      MsgBox "No USB disks detected or unknown error!", vbCritical + vbOkOnly, "USB"
  End If
  </code></pre>