How to programmatically change COM port FriendlyName

quantum1976

New member
Local time
1:39 PM
Messages
2
I have an installation script that changes the COM port numbers based on certain hardware that is installed. In Windows 2000, I use regini.exe to import the listing of registry entries below. The reason for this was to allow the permissions on the FriendlyName value to be changed.


HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\ACPI\PNP0501\1
Device Parameters
PortName = COM5
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ports
COM5: = "9600,n,8,1"
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ports
COM1: = Delete
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\ACPI\PNP0501\1 [7]
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\ACPI\PNP0501\1
FriendlyName = Communications Port (COM5)
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\ACPI\PNP0501\1 [8 17]



I tried this same process in Windows 7 and everything works except for changing the FriendlyName value. The only way I've been able to change this value is to manually (in regedit) "take ownership" of the "1" key and then change the permissions to Full Control. However, I need to do this in a script to make it transparent to the user.


Any help would be greatly appreciated,

Rich
 

My Computer

OS
Windows 7
I have an installation script that changes the COM port numbers based on certain hardware that is installed. In Windows 2000, I use regini.exe to import the listing of registry entries below. The reason for this was to allow the permissions on the FriendlyName value to be changed.


HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\ACPI\PNP0501\1
Device Parameters
PortName = COM5
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ports
COM5: = "9600,n,8,1"
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ports
COM1: = Delete
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\ACPI\PNP0501\1 [7]
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\ACPI\PNP0501\1
FriendlyName = Communications Port (COM5)
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\ACPI\PNP0501\1 [8 17]


I tried this same process in Windows 7 and everything works except for changing the FriendlyName value. The only way I've been able to change this value is to manually (in regedit) "take ownership" of the "1" key and then change the permissions to Full Control. However, I need to do this in a script to make it transparent to the user.


Any help would be greatly appreciated,

Rich

Hi and welcome to SevenForum
For your first forum message on SF this is really heavy man...:cool:
Seems like you like scripting.
Have fun. :D
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Self Built
OS
Windows 10 Pro
CPU
Intel i5
Motherboard
I have a fatherboard
Memory
I'm old and lost a few chips
Graphics Card(s)
Yup
Sound Card
Yup
Monitor(s) Displays
Samsung 32" UHD
Screen Resolution
3840 x 2160
Hard Drives
Samsung 860 EVO drives
PSU
450 Watt and some fans that blow
Case
Small tower
Cooling
Yes I am cool. lol
Keyboard
Who needs a keyboard?
Mouse
Logitech Laser G7 wireless
Internet Speed
Zippy fast UP and DOWN
Antivirus
I got a shot
Browser
The new Improved EDGE 2020
Yes, I've been doing this for years with Win 2K and XP. Fortunately I've been able to muddle throught it. But this one has me beat.

I know that Win 7 has the TakeOwn.exe utility for files, is there something similar for the registry?


Thanks again for any help,

Rich
 

My Computer

OS
Windows 7
Back
Top