title: Remove last 4 characters using VB script from folder name
body: <p>I am new to VB script and trying to create a script in which i am looping in a folder and printing all the  subfolder names in a output text file.</p>
  
  <p>All the subfolders have same 4 characters at the -tst , i want to remove this last 4 character and print rest of the name.</p>
  
  <p>For example - original name - Test_name-tst
  expected output name - Test_name .</p>
  
  <pre><code>    'Creates new log file and write in it
      Set FSO = CreateObject("Scripting.FileSystemObject")
      outFile="D:\Test\test_output.LOG"
      Set objFile = FSO.CreateTextFile(outFile,True)
  
      objFile.Write  "START_" &amp; vbCrLf
  strFolder ="C:\apps\Test\"
      'Get a reference to the folder you want to search
      Set FLD = FSO.GetFolder(strFolder).Subfolders
      'Loop through the folder and get the file names
      For Each Fil In FLD
      If InStr(Fil.Name , "-prj") Then
          objFile.Write Fil.Name &amp; vbCrLf
  End If
      Next
  </code></pre>
  
  <p>Thank you.</p>