Stay OUT of the system registry if you don't know what you're doing.
For XP, Vista, and Windows 7
1) right-click "my computer"
2) choose "properties"
3) Choose "device manager"
4) Select "Ports" (COM and LPT) and expand the tree list if necessary to view each of the ports
5) right-click on the particular port you want to reassign
6) Choose "port settings"
7) Choose "advanced"
8) Select the COM port number assignment you want to use for that device.
9) save your settings.