Use Regedt32 to navigate to:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ports

On the Edit menu, Add Value name <Port Name> as a type REG_SZ.
<Port Name> is the actual port such as LPT1: or COM3:.
In the String Editor, enter the correct value data.

NOTE: LPTx ports have a blank string.

NOTE: COMx ports have BaudRate,Parity,DataBits,StopBits,FlowControl where:

BaudRate=75,110,134,150,300,600,1200,1800,2400,4800,7200,9600,14400,19200,38400,57600, or 115,200

Parity=n,o,e,m, or s

DataBits=4,5,6,7, or 8

StopBits=1,1.5, or 2

FlowControl=not entered for none, p for hardware, or x for XON/XOFF.