title: Find text and assign to a variable with VBscript
body: <p>I have a program giving me output like below.</p>
  
  <pre><code>Listing 3 device(s) for setup class "Ports" (Ports (COM &amp; LPT)).
  USB\VID_067B&amp;PID_2303\5&amp;164808BA&amp;0&amp;3                        : Prolific USB-to-Serial Comm Port (COM3)
  USB\VID_068B&amp;PID_2304\5&amp;164808BA&amp;0&amp;3                        : Prolific USB-to-Serial Comm Port (COM4)
  USB\VID_069B&amp;PID_2305\5&amp;164808BA&amp;0&amp;3                        : Prolific USB-to-Serial Comm Port (COM6)
  </code></pre>
  
  <p>I would like to get the COM# value out and assign it to a variable using vbscript
  like so</p>
  
  <pre><code>P1=COM3
  P2=COM4
  P3=COM6
  </code></pre>
  
  <p>The persona this link <a href="http://vbcity.com/forums/t/154919.aspx" rel="nofollow">http://vbcity.com/forums/t/154919.aspx</a> is getting the output I want using the line.</p>
  
  <pre><code>System.IO.Ports.SerialPort.GetPortNames 
  </code></pre>
  
  <p>but I am not sure how to implement this in my script.</p>
  
  <p>Thanks </p>