title: Removing virtual COM Ports in c#
body: <p>I am creating a batch file to remove virtual com ports created before using com0com. at the time of creation, the port names where renamed for example:</p>
  
  <pre><code>change CNCA2 portname=COM20
  </code></pre>
  
  <p>So when i want to remove i should use the original name like:</p>
  
  <pre><code>remove 2 
  </code></pre>
  
  <p>which corresponds to the original portname <code>CNCA2</code></p>
  
  <p>So, what i m trying to do here is if the user chooses to remove Port COM20, how can get the
  original name which is <code>CNCxx</code> ?</p>
  
  <p>below is the sample of command i used:<img src="https://i.stack.imgur.com/3w88r.jpg" alt="enter image description here"></p>
  
  <p>as u can see, when i write <code>remove COM150</code> there is no change, so i need to get the corresponding name which is <code>remove 2</code>.</p>
  
  <p>so from the c# application how can i get the corresponding name without manually using a <code>list</code> command?</p>
  
  <p>Thanks.</p>