title: execute multiple batch file from VBscript
body: <p>I am trying to execute multiple batch files in a folder using vbscript. can anyone help me how to do it.
  Here is my code.</p>
  
  <pre><code> Varr1 = hostname
   UN = username
   password = pass
  set ObjFSO = createobject("Scripting.FileSystemObject")
       set FilePath = ObjFSO.getfolder("C:\test\script")
       set BatFile = FilePath.files
  
       for each m in BatFile
        If LCase(objFSO.GetExtension(FilePath.files)) = "bat" Then
           Set WShell = CreateObject("WScript.Shell")
           WShell.Run ("CMD /K C:\test\script "&amp;BatFile &amp;" " &amp; Varr1 &amp;" "&amp; UN &amp;" "&amp; password )
        End If
      Next
  </code></pre>