When I connect USB to serial converter, it connects to Port 11 on one laptop and com 20 on the other.
Now the question is that from control panel or device manager of the windows can I shift this USB to serial converter to something like com1 or com4.
Is there any way to force connect the USB to serial converter to a desired com port!
What specific USB to UART bridge device is utilized by your USB to Serial Converter?
Not all the features discussed below maybe applicable to your device and its driver.
Typically both the windows device driver and its setup information file (INF) of the USB to UART bridge device dictate the allocation of the virtual communication port (VCP) number as well as many other parameters.
The driver of FTDI FT232R, a common USB to UART bridge device, references its INF file during installation and sets the default first allowable COM port number, typically COM3, under the InitialIndex parameter contained in the Windows Register. When such a device is first plugged into a port the driver starts the search for the first available COM port number at the value contained in the InitialIndex parameter, if COM3, for example, is already allocated the value is incremented and checked for availability and allocated if not already in use.
Once a COM port has been allocated to a particular device the VID, PID and serial or ID number are stored in the registry for future reference.
For Example:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\FTDIBUS\VID_VID+PID_PID+Serial_Number\0000\DeviceParameters\PortName
Location of other related parameters:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\FTSER2K
You can change the COM port number assignments manually through the Device Manager => Ports (COM & LPT) => Specific Device => Port Settings => Advanced
Example Standard COM port settings:
FTDI FT232R COM port settings:
How COM Ports Are Allocated On Driver Installation
Also as nandhu015 suggested it is possible to develop a Windows or Control Panel application which modifies these registry settings directly.
However, I would caution you against developing such an application using your primary Windows system as the such code development is nontrivial and may have a significant negative impact on the registry and function of your system.
The attached application provides an example source code and compiled application to be ran in a "DOS" windows which scan the registry and displays all COM port allocations.
BigDog