How do I change the name of a serial port (COM1)?
<p>I can do it manually in a couple of clicks, but the whole internet doesn't have the answer on how to do it programmatically. Here is what I do manually:</p>

<pre><code>1. Open Device Manager.
2. Expand Ports.
3. Right-click Communication Port (COM1) and select Properties.
4. In the subsequent dialog click Port Settings tab, then click Advanced.
5. Select COM5 instead of COM1 in the COM Port Number combobox.
6. Click OK.
</code></pre>

<p>Now I need to do this from my application, and I just couldn't find a way. I can read all the properties of any com port using SerialPort class or even Win32_SerialPort API. But there is just no way to change the com port name...
Please, help me somebody.</p>
